API reference: @salmonui/data-grid/engine
SelectionMethodstype
import type { SelectionMethods } from '@salmonui/data-grid/engine';Also exported from @salmonui/data-grid/engine/selection.
type SelectionMethods<Row> = {
isRowSelected(ctx: ModuleContext<Row>, rowId: RowId): boolean;
isCellSelected(ctx: ModuleContext<Row>, rowId: RowId, columnId: ColumnId): boolean;
isColumnSelected(ctx: ModuleContext<Row>, columnId: ColumnId): boolean;
getSelectedRowIds(ctx: ModuleContext<Row>): readonly RowId[];
getSummary(ctx: ModuleContext<Row>): SelectionSummary;
serialize(ctx: ModuleContext<Row>): SerializedSelection;
preview(ctx: ModuleContext<Row>, command: SelectionCommand): SelectionPreview | null;
};
| Name | Signature | Description |
|---|---|---|
isRowSelected | isRowSelected(ctx: ModuleContext<Row>, rowId: RowId): boolean; | |
isCellSelected | isCellSelected(ctx: ModuleContext<Row>, rowId: RowId, columnId: ColumnId): boolean; | |
isColumnSelected | isColumnSelected(ctx: ModuleContext<Row>, columnId: ColumnId): boolean; | |
getSelectedRowIds | getSelectedRowIds(ctx: ModuleContext<Row>): readonly RowId[]; | Selected row ids in selection order ( |
getSummary | getSummary(ctx: ModuleContext<Row>): SelectionSummary; | |
serialize | serialize(ctx: ModuleContext<Row>): SerializedSelection; | |
preview | preview(ctx: ModuleContext<Row>, command: SelectionCommand): SelectionPreview | null; | Selection outcome of a command without applying it; null when nothing (rows, cells, columns) would change or the command is rejected. |