View as Markdown

API reference: @salmonui/data-grid

DataGridDataUiPropsinterface

import type { DataGridDataUiProps } from '@salmonui/data-grid';
interface DataGridDataUiProps<Row> {
    loadingIndicator?: 'spinner' | 'skeleton';
    renderLoading?: (ctx: DataGridLoadingContext) => ReactNode;
    onRowClick?: (event: DataGridRowClickEvent<Row>) => void;
    onRowDoubleClick?: (event: DataGridRowClickEvent<Row>) => void;
    onCellClick?: (event: DataGridCellClickEvent<Row>) => void;
    onCellDoubleClick?: (event: DataGridCellClickEvent<Row>) => void;
    recordCommands?: boolean;
    instrument?: boolean;
}

DataGrid props of the data-state UI, the click events, and the engine dev tooling.

DataGridDataUiProps members (8)
NameSignatureDescription
loadingIndicatoroptionalloadingIndicator?: 'spinner' | 'skeleton';

Built-in loading indicator. Default spinner.

renderLoadingoptionalrenderLoading?: (ctx: DataGridLoadingContext) => ReactNode;

Replaces the content of the loading indicator (presentational: the grid announces loading itself).

onRowClickoptionalonRowClick?: (event: DataGridRowClickEvent<Row>) => void;

A data row was clicked. preventDefault() skips the built-in selection and focus.

onRowDoubleClickoptionalonRowDoubleClick?: (event: DataGridRowClickEvent<Row>) => void;

A data row was double-clicked. preventDefault() skips the built-in edit start.

onCellClickoptionalonCellClick?: (event: DataGridCellClickEvent<Row>) => void;

A cell of a data row was clicked; fires before onRowClick.

onCellDoubleClickoptionalonCellDoubleClick?: (event: DataGridCellClickEvent<Row>) => void;

A cell of a data row was double-clicked; fires before onRowDoubleClick.

recordCommandsoptionalrecordCommands?: boolean;

Keeps a serializable log of applied commands (api.engine.getCommandLog()). Initial only. Default false.

instrumentoptionalinstrument?: boolean;

Exposes store counters (api.engine.getInstrumentation()). Initial only. Default false.