5.0
API
Interfaces
ReactGridAPI

ReactGridAPI

The ReactGridAPI interface is related to the useReactGridAPI hook and provides various methods to interact with the grid, such as selecting areas, focusing cells, and retrieving grid data.

Definition

interface ReactGridAPI {
  setSelectedArea: (range: NumericalRange) => void;
  setFocusedCell: ({ rowIndex, colIndex }: IndexedLocation) => void;
  setSelectedColumns: (startColIdx: number, endColIdx: number) => void;
  setSelectedRows: (startRowIdx: number, endRowIdx: number) => void;
  getFocusedCell: () => FocusedCell | null;
  getCellByIndexes: (rowIndex: number, colIndex: number) => Cell | null;
  getCellOrSpanMemberByIndexes: (rowIndex: number, colIndex: number) => Cell | SpanMember | null;
  getPaneRanges: () => Record<PaneName, NumericalRange>;
  getCellsLookup: () => CellsLookup;
  getSelectedArea: () => NumericalRange | null;
  getColumns: () => Column[];
  getRows: () => Row[];
}