DHTMLX Docs & Samples Explorer

moveRow(rowId,mode,targetId,targetGrid)

Required library edition: This method requires Professional Edition of the DHTMLX library
Required library file: dhtmlxgrid_drag.js

move row

  • rowId - the id of the source row (the row that will be moved)
  • mode - moving mode (up,down,row_sibling)
  • targetId - used just in the 'row-sibling' mode. The id of the target row (the row after which the source row will be pasted) (optional)
  • targetGrid - used for moving between grids (optional)
  //move row up
  mygrid1.moveRow("row1","up");
  //move row down
  mygrid1.moveRow("row1","down");
  //move row with id "row1" after row with id "row2" in grid[2]
  mygrid1.moveRow("row1","row_sibling","row2",mygrid2);

See also: moveRowTo, moveRowDown, moveRowUp