Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Andy Hartunian on Aug 27, 2008 10:01
open dhtmlx forum
How to prevent tree nodes from moving/copying between 2 trees

I have 2 trees on a page and I wish to enable drag and drop from one tree to another. However I do NOT want the
display to show the nodes as having been moved or copied between the trees. I wish to have an event get fired
and then I do what I want with the data involving the dragged node(s) and the drop-target node. I still want to show the
node(s) being dragged.

Thanks in advance
Answer posted by Support on Aug 27, 2008 10:16
Tree have a onDrag event which can be used for such case 

target_tree.attachEvent("onDrag",function(sid,tid,nid,sobj,tobj){
    //any custom code here
    return false; // block default d-n-d
});

parameters of d-n-d contains all necessary info
sid - source id ( drag )
tid - target id ( drop on )
sobj - source tree object
tobj - target tree object