5.0
API
Types
CellsLookup

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

NameTypeDescription
rowIndexnumberThe index of the row.
colIndexnumberThe index of the column.
onStringValueRequested() => stringCallback to get the cell value.
onStringValueReceived(v: string) => voidCallback to set the cell value.