Welcome Guest Search | Active Topics | Sign In | Register

Drag and drop in curent parent node in TreeView Options
Maxim
Posted: Sunday, December 28, 2008 5:34:36 PM
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.
eo_support
Posted: Monday, December 29, 2008 5:22:03 AM
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.html

Hope this helps.

Thanks


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.