glide-data-grid
glide-data-grid copied to clipboard
Add support for multi-column sort to the `useColumnSort` hook
Add support for multi-column sort to the useColumnSort hook in the source package.
Proposed API (changes to useColumnSort):
type ColumnSort = {
column: GridColumn;
mode?: "default" | "raw" | "smart";
direction?: "asc" | "desc";
};
type Props = Pick<DataEditorProps, "getCellContent" | "rows" | "columns"> & {
sort?: ColumnSort | ColumnSort[];
};
Thereby, the first column sort of the list takes priority and after that the data is sorted by the second provided ColumnSort option.
Yes please