PDA

View Full Version : Drag & Drop between trees without removing the original node?



vdsat1010
28 May 2009, 7:28 PM
I am having trouble changing drag and drop such that when i move a node from one tree to another, the original node stays and a copy is inserted into the target tree. I've tried implementing the beforeremove function by doing.

tree1.on('beforeremove', function(tree, node, rNode) {
return false;
});

tree2.on('beforeremove', function(tree, node, rNode) {
return false;
});

According to the API, returning false should cancel the remove, the node is still removed. Any help would be appreciated.

jdent
29 May 2009, 1:20 PM
Try using:
beforemovenode : ( Tree tree, Node node, Node oldParent, Node newParent, Number index )