DHTMLX Docs & Samples Explorer

Index
dhtmlxgrid
API Methods

### moveRowTo(srowId,trowId,mode,dropmode,sourceGrid,targetGrid)

Required library edition:
Required library file: dhtmlxgrid_drag.js

move row

- srowId - source row Id
- trowId - target row Id
- mode - “move” or “copy”
- dropmode - “sibling” or “child” (optional, “sibling” by default)
- sourceGrid - source grid object, used for moving between grids (optional, current grid by default)
- targetGrid - target grid object, used for moving between grids (optional, current grid by default)

Returns moved item ID

      //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);

See also: moveRowDown, moveRowUp, moveRow