Define/customize drag and drop rules in Tree


Hello,<?xml:namespace prefix = o ns = “urn:schemas-microsoft-com:office:office” /><o:p></o:p>



<o:p> </o:p>



I want to define/customize drag and drop rules in Tree. I have �Groups� and �Sections�(I am differentiating Groups and Sections with different icons) in the tree as shown below:<o:p></o:p>



<o:p> </o:p>



Group1<o:p></o:p>



Section 1<o:p></o:p>



Section 2<o:p></o:p>



Group 2<o:p></o:p>



Section 3<o:p></o:p>



Group 3<o:p></o:p>



Section 4<o:p></o:p>



Group 5 <o:p></o:p>



Group 6<o:p></o:p>



Section 5<o:p></o:p>



Section 6<o:p></o:p>



Section 7<o:p></o:p>



Group 7<o:p></o:p>



<o:p> </o:p>



Group can have sections and Groups as child nodes. Section NEVER have Group as a child. I could not able to perform the required functionality while using default drag and drop functionality. So, I want to customize default drag and drop functionality � any group node cannot be droppable under Section. Please let me know the best to perform the required above functionality.<o:p></o:p>



<o:p> </o:p>



Thanks,<o:p></o:p>



RamaRao R.<o:p></o:p>


Hello,


You can assign a property to each node that distinguishes groups from sections. It is possible using userdata:


<item…>1


<item…>0


or tree.setUserData(itemId,“is_group”,1);


And using onDragIn event you can block dragging sections into groups:


tree.attachEvent(“onDragIn”,function(sId,tId){


return !(tree.getUserData(sId,“is_group”)&&!tree.getUserData(tId,“is_group”));


})