SelectionMethods
Selection methods returned from useGridSelection.
Uses React context to access the grid ref - works reliably regardless of when the grid mounts or conditional rendering.
Properties
Section titled “Properties”| Property | Type | Description |
|---|---|---|
selectAll | () => void | Select all rows (row mode) or all cells (range mode). |
clearSelection | () => void | Clear all selection. |
getSelection | () => SelectionResult | unknown | Get the current selection state. Use this to derive selected rows, indices, etc. |
isCellSelected | (row: number, col: number) => boolean | Check if a specific cell is selected. |
setRanges | (ranges: CellRange[]) => void | Set selection ranges programmatically. |
getSelectedRows | () => TRow[] | Get actual row objects for the current selection. Works in all selection modes (row, cell, range) — resolves indices against the grid’s processed (sorted/filtered) rows. |
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