Try
this code as a dragDrop event handler for the tree and let me know if
it doesn't work.
function doDragDrop(event)
{
doDragExit(event);
doDragExit(event);
var items =
event.dragSource.dataForFormat(treeItems);
var dest = event.target;
var dropLoc = dest.getDropLocation();
var dest = event.target;
var dropLoc = dest.getDropLocation();
dest.clearSelected();
var dropParent = dest.getDropParent();
var dropParent = dest.getDropParent();
for (var i = items.length - 1; i >= 0; i--)
{
var newNode = dropParent.addTreeNodeAt(dropLoc,items[i]);
dest.selection = newNode;
}
}
-Ashish
I've been wracking my brains on this for a while now, and it hasn't
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of pilby1
Sent: Thursday, May 05, 2005 4:04 PM
To: [email protected]
Subject: [flexcoders] Tree Drag and Drop help
been a smooth ride. Instead of chanting my experiences in this forum,
it all boils down to my pleading for help from any of you.
Can anyone please provide me a code sample or a URL of such
pertaining to drag-n-drop with a Tree which can demonstrate a
successful drag of one node onto another, and having the dragged node
appear as a child of the node where it was dropped?
In a nutshell, I've gotten as far as getting the node references of
the dragged and dropped nodes within my dragDrop event, including the
index of the node that was dropped on. I can even display these two
nodes using "alert", and their internal toString() methods would
correctly display all the node contents (in XML). However, when I use
the addTreeNodeAt() method on a node that's a parent (i.e. a folder),
nothing happens! And when the node is a leaf (i.e., not a parent of
any child nodes), that node somehow "climbs" up one step higher in
the tree hierarchy, and the dragged node does not appear anywhere!
I would be very grateful to anyone who could provide me some help and
guidance on this please. :(
Yahoo! Groups Links
- To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

