Sorting allows users to list the data in ascending or descending order. There are three ways for a user to sort:
Shift key while clicking on the second sort button.You must opt-in to column sorting by setting the features.sort prop to true or
utilzing the options object. Doing so will display the sorting options in the column menu.
Multi-column sorting is enabled by default on the toggle sort button. To use
multi-column sorting hold the Shift key while clicking on the second sort button.
A comparator determines how two cell values should be sorted. The default comparator
uses the vanilla JavaScript basic comparison of a and b.
When using the accessorFn method, the comparator uses the value returned from the
accessorFn callback provided as the first argument.
To provide a custom comparator, you can pass a function as the features.sort.comparator option.
The sort feature accepts either a boolean or an object with the following properties:
| Params | Required | Description |
|---|---|---|
firstSortDirection | false | The initial sort direction for the column. |
comparator | false | A custom comparator function for sorting. |