API reference: @salmonui/data-grid
DataGridSelectioninterface
import type { DataGridSelection } from '@salmonui/data-grid';interface DataGridSelection {
readonly multiple?: boolean;
readonly mode?: 'row' | 'cell' | 'both';
readonly cellRange?: 'flow' | 'box' | 'boxWithBorder';
readonly checkboxRowClick?: 'add' | 'replace';
readonly checkboxOnly?: boolean;
readonly toggle?: boolean;
readonly persistent?: boolean;
readonly additive?: boolean;
readonly columns?: boolean;
readonly rowIds?: readonly RowId[];
}
selection prop. Selection is on by default (single row).
| Name | Signature | Description |
|---|---|---|
multipleoptional | readonly multiple?: boolean; | Several rows (or cells). Default false (single). |
modeoptional | readonly mode?: 'row' | 'cell' | 'both'; | Default |
cellRangeoptional | readonly cellRange?: 'flow' | 'box' | 'boxWithBorder'; | Cell range shape. Default |
checkboxRowClickoptional | readonly checkboxRowClick?: 'add' | 'replace'; | With a |
checkboxOnlyoptional | readonly checkboxOnly?: boolean; | Only the selection column's checkbox selects rows. |
toggleoptional | readonly toggle?: boolean; | Clicking the only selected row deselects it. Default true. |
persistentoptional | readonly persistent?: boolean; | Keep selection across sort, filter, search, page, and group changes. Default false. |
additiveoptional | readonly additive?: boolean; | Plain clicks add to the selection (no modifier keys) in multiple mode. |
columnsoptional | readonly columns?: boolean; | Column selection. |
rowIdsoptional | readonly rowIds?: readonly RowId[]; | Selected row ids. Reactive: a changed value re-applies. |