Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Richard White on Mar 10, 2009 08:12
open dhtmlx forum
Moving items in tree grid

Hi,

we have a tree grid and one tree node has 5 children, with code we want to move the fifth item to the top of the group (just below the parent item) with code. do you have a function to do this please....

we have tried using moverowto and setting the dropmode as "child" but it places it at the bottom of the list of children

if you dont have a function that allows us to move it to the top of the list of children then do you have a work around please

thanks
Answer posted by Support on Mar 11, 2009 03:04
There is no way to use moveRowTo for such operation ( except of two step processing - move row as sibling of top child and move top child as sibling of moved item )
But you can use low level API

var drag = new dragContext("treeGrid","treeGrid","move","sibling",sid,tid,mygrid,mygrid);
mygrid._sbmod=true;
mygrid._dragRoutine(drag.set("alfa",1));
drag.close();