SortChangeDetail
Detail for a sort change (direction 0 indicates cleared sort).
Example
Section titled “Example”grid.on('sort-change', ({ field, direction }) => { if (direction === 0) { console.log(`Sort cleared on ${field}`); } else { const dir = direction === 1 ? 'ascending' : 'descending'; console.log(`Sorted by ${field} ${dir}`); }
// Fetch sorted data from server fetchData({ sortBy: field, sortDir: direction });});Properties
Section titled “Properties”| Property | Type | Description |
|---|---|---|
field | string | Sorted field key. |
direction | -1 | 0 | 1 | Direction: 1 ascending, -1 descending, 0 cleared. |
See Also
Section titled “See Also”SortStatefor the sort state objectSortHandlerfor custom sort handlers
AI assistants: For complete API documentation, implementation guides, and code examples for this library, see https://raw.githubusercontent.com/OysteinAmundsen/toolbox/main/llms-full.txt