View as Markdown

API reference: @salmonui/data-grid

DataGridCellClickEventinterface

import type { DataGridCellClickEvent } from '@salmonui/data-grid';
interface DataGridCellClickEvent<Row> extends DataGridEvent {
    readonly rowId: RowId;
    readonly row: Row;
    readonly rowIndex: number;
    readonly field: string;
    readonly column: DataGridColumnInfo<Row> | null;
    readonly value: unknown;
    readonly element: HTMLElement;
    readonly nativeEvent: MouseEvent;
}

onCellClick / onCellDoubleClick. preventDefault() cancels the built-in action.

DataGridCellClickEvent members (12, 4 inherited)
NameSignatureDescription
rowIdreadonly rowId: RowId;
rowreadonly row: Row;
rowIndexreadonly rowIndex: number;
fieldreadonly field: string;
columnreadonly column: DataGridColumnInfo<Row> | null;
valuereadonly value: unknown;

The cell value (valueGetter, else field).

elementreadonly element: HTMLElement;

The cell element.

nativeEventreadonly nativeEvent: MouseEvent;
typeinheritedtype: string;

'sortChange', 'beforeSortChange', ...

sourceinheritedsource: DataGridEventSource;
defaultPreventedinheriteddefaultPrevented: boolean;

True after preventDefault() (before-events and click events).

preventDefaultinheritedpreventDefault: () => void;

Before-events and click events: cancels the action (or the built-in behavior).