In the above example, each column is configured to be sortable. When the header cell of a column is clicked, the sort order is toggled between ascending, descending and none. You can see the code by clicking the blue rectangular Show Editor View button above, and also edit the example in the code editor directly.
Configuring the column
To make a given column sortable, set
column.sortable = true
The grid provides an
onGridSort prop which is called whenever the header cell of the column is clicked. You can handle this callback in your component to modify the sort order of the grid rows.
To enable a column to be sorted in descending order first set
column.sortDescendingFirst = true prop.