DHTMLX Docs & Samples Explorer

sortRows(col, type, order)

Required library edition: This method works with any edition of DHTMLX library
Required library file: dhtmlxgrid.js

sort grid

  • col - index of column, by which grid need to be sorted
  • type - sorting type (str,int,date), optional, by default sorting type taken from column setting
  • order - sorting order (asc,des), optional, by default sorting order based on previous sorting operation
   //sort first column in grid
   mygrid.sortRows(0);
   //sort first column in grid by "str" type in "des" order
   mygrid.sortRows(0,"str","des");

See also: enableStableSorting, setCustomSorting, setSortImgState