API REFERENCE
sortBy
Sets one column's sorting. Omitted direction cycles sorting; null clears that column. Use setSortModel for the full multi-column model.
What does this API do?
Sets one column's sorting. Omitted direction cycles sorting; null clears that column. Use setSortModel for the full multi-column model.
Exact input and result types
sortBy(column: string, direction?: GridSortDirection | null): Promise<void>| Arguments | Required | Type |
|---|---|---|
| column | Required | string |
| direction | Optional | GridSortDirection | null |
The return type is Promise<void>.
Usage flow
After registering and initializing the Grid element, call grid.sortBy(…). Read the return value with await. For methods returning a boolean or report, inspect the result before continuing.
Read related types
Feature explanations and examples
- Single and multiple sorting
Sorting changes display order without modifying data values. Single sorting uses one criterion; multiple sorting uses prioritized criteria.