Skip to content

SortModel

Represents a single column’s sort configuration within a multi-sort model.

The order of SortModel entries in the array determines sort precedence: the first entry is the primary sort, the second breaks ties in the primary, and so on.

// Primary: department ascending, secondary: salary descending
const sortModel: SortModel[] = [
{ field: 'department', direction: 'asc' },
{ field: 'salary', direction: 'desc' },
];
PropertyTypeDescription
fieldstringThe column field key to sort by. Must match a field in the grid’s column configuration.
directiondesc | ascSort direction: 'asc' for ascending (A→Z, 0→9), 'desc' for descending (Z→A, 9→0).
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