View as Markdown

API reference: @salmonui/data-grid

DataGridAddEventinterface

import type { DataGridAddEvent } from '@salmonui/data-grid';
interface DataGridAddEvent<Row> extends DataGridEvent {
    readonly row: Readonly<Record<string, unknown>> | undefined;
    readonly position: 'top' | 'bottom';
    readonly rowId: RowId | null;
    readonly isNew: true;
    readonly _row?: Row;
}

onBeforeAdd / onAdd.

DataGridAddEvent members (9, 4 inherited)
NameSignatureDescription
rowreadonly row: Readonly<Record<string, unknown>> | undefined;

Initial values passed to addRow (by column id).

positionreadonly position: 'top' | 'bottom';
rowIdreadonly rowId: RowId | null;

Temporary id of the added row (after-event only).

isNewreadonly isNew: true;
_rowoptionalreadonly _row?: Row;

Type witness.

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