Check documentation for the latest version of dhtmlxSuite moveRowTo DHTMLX Docs

moveRowTo

moves a row

void moveRowTo(string|number srowId,string|number trowId,string mode, [string dropmode,object sourceGrid,object targetGrid] );
srowIdstring|numberthe id of the source row (the row that will be moved or copied)
trowIdstring|numberthe id of the target row (in the 'sibling' mode - the row after which the source row will be pasted, in the 'child' mode - the row that will be the parent for the source row in the specified grid)
modestring"move" or "copy"
dropmodestring"sibling" or "child" (optional, "sibling" by default)
sourceGridobjectsource grid object used for moving between grids (optional, current grid by default)
targetGridobjecttarget grid object used for moving between grids (optional, current grid by default)

Available only in PRO Edition

Example

//move row with id "row1" after row with id "row2"
myTreeGrid1.moveRowTo("row1","row2","move");
//copy row with id "row1" from treegrid[1] as child of row with id "row2" in treegrid[2]
var movedId=myTreeGrid1.moveRowTo("row1","row2","copy","child",myTreeGrid1,myTreeGrid2);

Details

Details on the trowId parameter - the target row is:

  • in the 'sibling' mode - the row after which the source row will be pasted
  • in the 'child' mode - the row that will be the parent for the source row in the specified grid
Back to top