returns an array of objects with the current parameters of sorting applied to the data
Usageâinterface ISortingState {
by: string | number,
dir: "asc" | "desc",
as?: (a) => any,
rule?: (a, b) => number,
smartSorting?: boolean
}
getSortingStates(): ISortingState[];
Returns:
An array of objects with the current parameters of sorting applied to the data.
Example
const state = grid.data.getSortingStates();
// -> [{by: "country", dir: "desc"}, {by: "population", dir: "desc"}]
The array returned by the method contains objects with the following properties:
by (string | number) the id of a data field to sort by dir (string) the direction of sorting: "asc" or "desc" as (function) optional, a custom function of converting values before comparing rule (function) optional, a custom sorting function smartSorting (boolean) optional, (if applied) specifies whether a sorting rule should be applied each time after changing the data set Change log:added in v9.1
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4