Introduction
The CellsLookup
is designed to work specifically with string
values, allowing you to retrieve and update cells data. The primary use case for CellsLookup
is within operations like cut, copy, paste, and fill, where you need to access or modify cell content based on row and column indices. This type functions as a mapping of cell coordinates, identified by row and column indices, to callback functions. These callbacks— onStringValueRequested
and onStringValueReceived—enable
interaction with the grid's cell values, helping facilitate tasks such as data editing, copying, and filling, all while ensuring the values remain in a string
format for consistency and simplicity.
Definition
type CellsLookup<
RowIdxType extends number = number,
ColIdxType extends number = number
> = Map<`${RowIdxType} ${ColIdxType}`, CellsLookupCallbacks>;
type CellsLookupCallbacks = {
rowIndex: number;
colIndex: number;
onStringValueRequested: () => string;
onStringValueReceived: (v: string) => void;
};
Properties
Name | Type | Description |
---|---|---|
rowIndex | number | The index of the row. |
colIndex | number | The index of the column. |
onStringValueRequested | () => string | Callback to get the cell value. |
onStringValueReceived | (v: string) => void | Callback to set the cell value. |