Ref
See how to use a ref to control the grid from a parent.
Reading values
activeCell
Type:
{ colId?: string, col: number, row: number } | null
The active / highlighted cell or null if no cell is active. col
is the index of the column and colId
is its id
if it is specified.
selection
Type:
{ min: Cell, max: Cell } | null
The current selection rect or null if nothing is selected or active. min
and max
are of the same type as activeCell
.
Writing values
setActiveCell
Type:
(activeCell: { col: number | string, row: number } | null) => void
Set the current active cell, pass null to blur the grid. The column can be specified using its index (a number) or its id
(a string).
setSelection
Type:
(selection: { min: Cell, max: Cell } | null) => void
Set the current selection, pass null to blur the grid. min
and max
are of the same type as setActiveCell
.