PDA

View Full Version : Drag-Drop between two trees - avoid removing node



venu
20 Jul 2009, 3:13 AM
Hi,

I am having 2 trees and from one tree need to drag the node to another tree.
Working fine but the node is removed from the 1st tree which i won't to avoid.

I added below code but not working.


treepanel.on('beforeremove', function(tree, parent, node ){
alert('beforeremove fired');
return false;
});


Any suggestions to resolve this problem.

Thanks,
Venu

Condor
20 Jul 2009, 3:24 AM
You need to clone the node before it is dropped (example here (http://extjs.com/forum/showthread.php?p=24223#post24223)).

venu
20 Jul 2009, 7:50 PM
Thanks condor, example helped a lot.