View as Markdown

API reference: @salmonui/data-grid

DataGridSortinginterface

import type { DataGridSorting } from '@salmonui/data-grid';
interface DataGridSorting {
    multiple?: boolean;
    order?: readonly (DataGridSortDirection | null)[];
    sortBy?: readonly DataGridSortItem[];
    indicators?: 'sorted' | 'always';
}

sorting prop.

DataGridSorting members (4)
NameSignatureDescription
multipleoptionalmultiple?: boolean;

Ctrl/Cmd+click and Ctrl/Cmd+Enter add columns to the sort. Default false.

orderoptionalorder?: readonly (DataGridSortDirection | null)[];

Header click cycle. Default ['asc', 'desc', null]; ['asc', 'desc'] never unsorts.

sortByoptionalsortBy?: readonly DataGridSortItem[];

Sorted columns, in priority order.

indicatorsoptionalindicators?: 'sorted' | 'always';

'sorted' (default): only a sorted header shows its direction arrow. 'always': every sortable header shows an up and down arrow pair, the active direction highlighted.