View as Markdown

API reference: @salmonui/data-grid/engine

EditStateinterface

import type { EditState } from '@salmonui/data-grid/engine';

Also exported from @salmonui/data-grid/engine/edit.

interface EditState {
    readonly options: ResolvedEditOptions;
    readonly version: number;
    readonly newRowId: RowId | null;
    readonly active: EditTarget | null;
    readonly status: EditStatus;
    readonly dirtyCellCount: number;
    readonly addedRowIds: readonly RowId[];
    readonly deletedRowIds: readonly RowId[];
    readonly pendingWrites: number;
    readonly lastError: string | null;
    readonly lastBulk: {
        readonly requested: number;
        readonly applied: number;
    } | null;
    readonly canUndo: boolean;
    readonly addedTreePlacements?: Readonly<Record<RowId, AddedTreePlacement>>;
    readonly canRedo: boolean;
    readonly change: EditChange;
}
EditState members (15)
NameSignatureDescription
optionsreadonly options: ResolvedEditOptions;
versionreadonly version: number;
newRowIdreadonly newRowId: RowId | null;

The always-visible add row (showNewRow), or null. It is not in addedRowIds and counts as an unsaved change only once it has a changed value; a fresh id follows every save or cancel of it.

activereadonly active: EditTarget | null;
statusreadonly status: EditStatus;
dirtyCellCountreadonly dirtyCellCount: number;
addedRowIdsreadonly addedRowIds: readonly RowId[];

Added, unsaved rows in display order (identity changes only when the list changes).

deletedRowIdsreadonly deletedRowIds: readonly RowId[];

Rows marked for deletion in batch mode.

pendingWritesreadonly pendingWrites: number;
lastErrorreadonly lastError: string | null;

Message of the last failed write, cleared by the next successful one.

lastBulkreadonly lastBulk: { readonly requested: number; readonly applied: number; } | null;

Outcome of the last edit.setValues (paste, fill): cells requested and cells that took a value.

canUndoreadonly canUndo: boolean;

An edit.undo would apply (always false with undo: false).

addedTreePlacementsoptionalreadonly addedTreePlacements?: Readonly<Record<RowId, AddedTreePlacement>>;

Tree mode: where each added row goes (above / below / child of an anchor row); absent when none.

canRedoreadonly canRedo: boolean;

An edit.redo would apply.

changereadonly change: EditChange;