Check documentation for the latest version of dhtmlxSuite sortTreeRows DHTMLX Docs

sortTreeRows

sorts TreeGrid by the specified column

void sortTreeRows(number col,string type,string order);
colnumberthe index of the column, by which the TreeGrid 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 TreeGrid
myTreeGrid.sortRows(0);
// sort the first column in the TreeGrid by the "str" type in the "des" order
myTreeGrid.sortRows(0,"str","des");

Back to top