View as Markdown

API reference: @salmonui/data-grid

DataGridCellPropsinterface

import type { DataGridCellProps } from '@salmonui/data-grid';
interface DataGridCellProps<Row> {
    rowId: RowId;
    column: CompiledColumn<Row>;
    rowIndex: number;
    colIndex: number;
    colSpan?: number;
    rowSpan?: number;
    spanStyle?: CSSProperties | undefined;
    spanAnchor?: boolean;
    renderKey?: number | undefined;
}
DataGridCellProps members (9)
NameSignatureDescription
rowIdrowId: RowId;
columncolumn: CompiledColumn<Row>;
rowIndexrowIndex: number;
colIndexcolIndex: number;

1-based aria-colindex (display position among visible leaves).

colSpanoptionalcolSpan?: number;

Cell span: aria-colspan / aria-rowspan and the spanned width/height.

rowSpanoptionalrowSpan?: number;
spanStyleoptionalspanStyle?: CSSProperties | undefined;
spanAnchoroptionalspanAnchor?: boolean;

A row span whose first row is above the rendered window, drawn in the window's first row: the cell carries its own data-row-id so pointer, focus and context-menu targets resolve to the span's row.

renderKeyoptionalrenderKey?: number | undefined;

Render key of the column's render-only fields (renderCell, cellClassName, ...): changes when one of them changed without a recompile, so memo re-renders this column's cells only.