View as Markdown

API reference: @salmonui/data-grid

DataGridRowClickEventinterface

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

onRowClick / onRowDoubleClick. preventDefault() cancels the built-in action.

DataGridRowClickEvent members (11, 4 inherited)
NameSignatureDescription
rowIdreadonly rowId: RowId;
rowreadonly row: Row;
rowIndexreadonly rowIndex: number;

Visible index of the row.

fieldreadonly field: string | null;

Column key of the clicked cell, or null outside a cell.

columnreadonly column: DataGridColumnInfo<Row> | null;
elementreadonly element: HTMLElement;

The row 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).