Welcome Guest Search | Active Topics | Sign In | Register

Question Options
Galaxy
Posted: Sunday, May 23, 2010 6:05:38 AM
Rank: Newbie
Groups: Member

Joined: 4/29/2008
Posts: 4
Hi
I set this structure in my Tree :
Root1 > Root2 > Root3 > Root4
I want change it to Root1 > Root4 > Root3 > Root2 with Drag and Drop and save it to DataBase (clientside)
Please help me how can i do that

Thanks
Best Regard
eo_support
Posted: Sunday, May 23, 2010 8:09:45 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

The drag and drop occurs on client side. Saving it to database must occur on the server side. Here is a working example about how to do this:

http://demo.essentialobjects.com/Default.aspx?path=TreeView\_i2\_i0

You can check the full source code of the sample to see how it works.

Thanks!
Galaxy
Posted: Sunday, May 23, 2010 9:14:24 AM
Rank: Newbie
Groups: Member

Joined: 4/29/2008
Posts: 4
I use this clientside code and update database by JQuery ajax:
treeview_dragdrop_handler(treeview, srcNode, destNode, newIndex){}
I update parent status and I can't update node order. when i get nextsibling it return prev status.
(Root1 > Root2 > Root3 > Root4 ...... to ...... Root1 > Root4 > Root3 > Root2)

Best Regards
eo_support
Posted: Sunday, May 23, 2010 12:44:39 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

This is normal. ClientSideOnDragDrop is fired before the node is dropped so that you have a chance to cancel the drop. In order to get the status after the drop you can still handle ClientSideOnDragDrop, but delay your actualy with a timer. It will be something like this:

Code: JavaScript
function your_handler(treeView, srcNode, destNode, newIndex)
{
     setTimeout(function()
    {
        //your code here....
        ....
    }, 10);
}


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.