Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Jason on Jul 30, 2008 17:11
open dhtmlx forum
Tree Grid Changing Parent

Is there a way to move a node to another node anywhere in the tree?

IE:

-Parent1
--c1
--c2
-Parent2
--c3

Either move c2 underneath c1 or move c2 to parent2. I would like the ability to do both.

Thank You,
-Jason
Answer posted by Support on Jul 31, 2008 02:07
TreeGrid can use moveRowTo method, to move row at any position in grid

>>move c2 underneath c1
    grid.moveRowTo("c2","c1","move","child")

>>move c2 to parent2
    grid.moveRowTo("c2","parent2","move","child")
Answer posted by Jason on Jul 31, 2008 08:49
I notice that in terms of the dataprocessor it deletes the row and re-adds it under the new parent. Is there a way to just "move" it? Or am I going to have to do some special data processing to simulate this? There is a bunch of extra data with my grid items that does not display in the grid that I don't want to lose because of a delete/insert.
Answer posted by Support on Jul 31, 2008 10:01

The move operation in treegrid is really a combination of add|delete operation. But grid preserves all defined values and userdata. 
If you need version of datapocessor which will treat row d-n-d as "update" operation - please contact us directly at support@dhtmlx.com - we will provide an updated js file ( it will not change the logic in grid, just the way how information synced with backend )