Check documentation for the latest version of dhtmlxSuite sortRows DHTMLX Docs

sortRows

sorts the Grid by the specified column

void sortRows(number col,string type,string order);
colnumberthe index of the column, by which the grid needs to be sorted
typestringthe sorting type ("str"|"int"|"date"), optional, by default the sorting type is taken from the column's setting
orderstringthe sorting order ("asc"|"des"), optional, by default the sorting order is based on the previous sorting operation

Example

//sort the first column in the grid
myGrid.sortRows(0);
//sort the first column in the grid by the "str" type in the "des" order
myGrid.sortRows(0,"str","des");

Back to top