|
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
|
|
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\_i0You can check the full source code of the sample to see how it works. Thanks!
|
|
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
|
|
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
|
|