View as Markdown

API reference: @salmonui/data-grid/engine

WriteRequestinterface

import type { WriteRequest } from '@salmonui/data-grid/engine';
interface WriteRequest<Row> {
    readonly version: number;
    readonly added: readonly {
        readonly tempId: RowId;
        readonly row: Row;
        readonly parentId?: RowId | null;
    }[];
    readonly changed: readonly {
        readonly rowId: RowId;
        readonly row: Row;
        readonly previous: Row;
        readonly changedColumnIds: readonly ColumnId[];
    }[];
    readonly deleted: readonly {
        readonly rowId: RowId;
        readonly row: Row;
    }[];
    readonly mode: 'row' | 'dialog' | 'batch' | 'cell';
    readonly signal: AbortSignalLike;
    readonly moved?: RowPlacement;
}
WriteRequest members (7)
NameSignatureDescription
versionreadonly version: number;
addedreadonly added: readonly { readonly tempId: RowId; readonly row: Row; readonly parentId?: RowId | null; }[];

parentId (tree mode): the parent the added row joins (null: a root); its parentIdField value is already set for flat data.

changedreadonly changed: readonly { readonly rowId: RowId; readonly row: Row; readonly previous: Row; readonly changedColumnIds: readonly ColumnId[]; }[];
deletedreadonly deleted: readonly { readonly rowId: RowId; readonly row: Row; }[];
modereadonly mode: 'row' | 'dialog' | 'batch' | 'cell';
signalreadonly signal: AbortSignalLike;
movedoptionalreadonly moved?: RowPlacement;

Row reorder placement hint (row drag and drop): local sources move the rows in their array.