DHTMLX Docs & Samples Explorer

Index
dhtmlxgrid
API Methods

### getSortingState()

Required library edition:
Required library file: dhtmlxgrid.js

get sorting state of grid

Returns array, first element is index of sorted column, second - direction of sorting (“asc” or “des”).

        var state=mygrid.getSortingState();

state[0] - index of sorted column;
state[1] - direction of sorting (“asc” or “des”).

If no one column was sorted method returns empty array.

See also: sortRows, setColSorting, setCustomSorting, setSortImgState, enableStableSorting