moveRowTo

moves a row

void moveRowTo(string|number srowId,string|number trowId,string mode, [string dropmode,object sourceGrid,object targetGrid] );

Parameters

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"
myGrid1.moveRowTo("row1","row2","move");
//copy row with id "row1" from grid[1] as child of row with id "row2" in grid[2]
var movedId=myGrid1.moveRowTo("row1","row2","copy","child",myGrid1,myGrid2);

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