Rank: Advanced Member Groups: Member
Joined: 12/26/2008 Posts: 45
|
How can i drag & drop item ONLY inside current parent node? I want decline drag & drop item into other parents.
thanks.
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi, You will need to handle the TreeView's ClientSideOnDragDrop event. It will be something like this:
Code: HTML/ASPX
<eo:TreeView ClientSideOnDragDrop="drag_drop_handler" ....>
....
</eo:TreeView>
Code: JavaScript
function drag_drop_handler(treeView, srcNode, destNode, newIndex)
{
//Cancel drag drop unless destNode is the parent node of srcNode
if (srcNode.getParentGroup().getParentItem() != destNode)
return false;
}
If you are not already familiar with the client side interface, you may wish to go over this topic: http://www.essentialobjects.com/ViewDoc.aspx?t=clientapi_howto.htmlHope this helps. Thanks
|