Skip to content

SortHandler

Since v0.2.7

Custom sort handler function signature.

Use SortHandler only when you need to replace the grid’s sort engine wholesale.

type SortHandler = (rows: TRow[], sortState: SortState, columns: ColumnConfig<TRow>[]) => TRow[] | Promise<TRow[]>
// Replace the built-in sort with a third-party stable sort library
const customSortHandler: SortHandler<Employee> = (rows, state) => {
return thirdPartyStableSort(rows, state.field, state.direction);
};
grid.gridConfig = { sortHandler: customSortHandler };
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