View as Markdown

API reference: @salmonui/data-grid

DataGridCellContextinterface

import type { DataGridCellContext } from '@salmonui/data-grid';
interface DataGridCellContext<Row> {
    row: Row;
    rowId: RowId;
    field: string;
    column: DataGridColumnInfo<Row>;
    value: unknown;
    formattedValue: string;
    rowIndex: number;
    selected: boolean;
    editing: boolean;
    tree?: DataGridTreeContext;
}
DataGridCellContext members (10)
NameSignatureDescription
rowrow: Row;
rowIdrowId: RowId;
fieldfield: string;

The column key (column id, else field).

columncolumn: DataGridColumnInfo<Row>;
valuevalue: unknown;
formattedValueformattedValue: string;
rowIndexrowIndex: number;
selectedselected: boolean;
editingediting: boolean;
treeoptionaltree?: DataGridTreeContext;

Tree mode, the tree column's cells only: depth, children, expansion and child load status.