I have a List with an item renderer and would like to enable drag-and-drop onto the items in the list, rather than adding the data to the list. Is it possible to find the item that is being hovered over when dragging?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can save the data that is being dragged from another element, using a “dragHandler” when the drag action starts like this:
"dragHandler" should look like this:
You can save the selectedItems in a vector because that is the nature of the elements being dragged.
Then in the itemRenderer of the list where you are going to drop the elements you have to set the property "dragEnter" in an element of the itemRenderer like a Group or a SkinnableContainer:
Your "dragEnterHandler" should look like this:
Doing this will prevent the elements from being added to your list.
And still in your Group or Skinnablecontainer of your itemRenderer you should have a "dragDrop" property set:
Then your "dragDropHandler"should look like this:
This way you don't have the need to explore the event variable of the dropped element because you already saved the items dragged in the "dragHandler" method