When a drag & drop operation occurs on a tree, the drag & drop handlers
call the public calculateDropIndex() function. This function stores all
the properties that you want in an mx_internal variable called _dropData
of Object data type.
 
So, make sure that your class import and use the mx_internal namespace
and attach a listener to the tree's dragDrop event. In the event
handler, look up the _dropData variable and specifically the "parent"
and "index" properties. If this drop operation should not be allowed,
call the preventDefault() method on the event.
 
That should do the trick.

________________________________

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of David Kramer
Sent: Monday, February 02, 2009 12:34 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Tree Control Drag and Drop Help



Adrian,
 
I am up against the same problem.  Please share your knowledge on it so
far.  kramer.da...@consultant.com <mailto:kramer.da...@consultant.com> 
 
Many thanks.
 
David

________________________________

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of adrianpomilio
Sent: Monday, February 02, 2009 8:45 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Tree Control Drag and Drop Help



This is a two part question.

1 - How can I keep a child from being dropped outside of it's parent?
I want to be able to drag and drop within a nodes parent.

2 - How do I get a handle on the new index of the node that has been
dropped.

I can get the current index, the parents name, but not the location it
was dropped.

I am using an ArrayCollection to populate the tree, using the children
attribute to create the child nodes. I am stuck with having to use
the ArrayCollection.

Any pointers would be great.



 

Reply via email to