Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by shalini on Aug 31, 2009 04:10
open dhtmlx forum
DHTMLTREE : HOW TO RESTRICT DROP ON SELECTED TREE NODES with dragindhtmlxtree

please find my coe attached
I want to do

1. Branch Tree node at level 4 can be droppbale to role tree and only this node will be deleted from branch tree nothing else should happen
2. no tree can drop anything on itself
3. when i drag and drod role tree data on brnach tree: it adds there if the target node level is 3 and with new as tid+'@' sid and if it doesn't there already and sid will remain be there in the role tree.
Answer posted by Alex (support) on Aug 31, 2009 08:37

Hello, 

there is onDrag event. If its handler returns true the drag-n-drop confirmed, else denied. 

>> Branch Tree node at level 4 can be droppbale to role tree and only this node will be deleted from branch tree nothing else should happen

You can deny drag-n-drop using onDrag and delete node using deleteItem method.

>> no tree can drop anything on itself

onDrag gets tree objects as 4th and 5th parameter

>> when i drag and drod role tree data on brnach tree: it adds there if the target node level is 3 and with new as tid+'@' sid and if it doesn't there already and sid will remain be there in the role tree.

there is changeItemId method. You can use it to change id.