View as Markdown

API reference: @salmonui/data-grid/engine

EditOptionsinterface

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

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

interface EditOptions<Row = unknown> {
    readonly enabled?: boolean;
    readonly edit?: boolean;
    readonly add?: boolean;
    readonly delete?: boolean;
    readonly mode?: EditMode;
    readonly newRowPosition?: NewRowPosition;
    readonly showNewRow?: boolean;
    readonly tabToNextRow?: boolean;
    readonly isCellEditable?: (ctx: EditCellContext<Row>) => boolean;
    readonly validateRow?: RowValidator<Row>;
    readonly messages?: Partial<EditMessageTable>;
    readonly newRow?: () => Partial<Row>;
    readonly undo?: boolean;
    readonly undoLimit?: number;
    readonly keyedRows?: boolean;
}
EditOptions members (15)
NameSignatureDescription
enabledoptionalreadonly enabled?: boolean;

Default true.

editoptionalreadonly edit?: boolean;

Existing rows can be edited. Default true.

addoptionalreadonly add?: boolean;

Rows can be added. Default true.

deleteoptionalreadonly delete?: boolean;

Rows can be deleted. Default true.

modeoptionalreadonly mode?: EditMode;

row is inline row editing. Default row.

newRowPositionoptionalreadonly newRowPosition?: NewRowPosition;

Where added rows appear. Default top. Tree mode: above / below the focused row as its sibling, or as its last child; the added row carries its parentId in WriteRequest.added.

showNewRowoptionalreadonly showNewRow?: boolean;

An always-visible blank add row at newRowPosition; row mode only. Saving it writes the record and shows a fresh blank row. Default false.

tabToNextRowoptionalreadonly tabToNextRow?: boolean;

Tab from the last editable cell continues in the next row. Default true in batch and cell mode, false otherwise.

isCellEditableoptionalreadonly isCellEditable?: (ctx: EditCellContext<Row>) => boolean;

Extra per-cell policy (canEditCell); column and row rules apply first.

validateRowoptionalreadonly validateRow?: RowValidator<Row>;

Row-level validation before a row (or batch) commits; may be async.

messagesoptionalreadonly messages?: Partial<EditMessageTable>;

Validation and save / conflict message overrides (EditMessages).

newRowoptionalreadonly newRow?: () => Partial<Row>;

Initial values of an added row, merged over the columns' defaultValue.

undooptionalreadonly undo?: boolean;

Records an undo history. Default false: nothing is recorded.

undoLimitoptionalreadonly undoLimit?: number;

Maximum undo entries kept (oldest dropped first). Default 10.

keyedRowsoptionalreadonly keyedRows?: boolean;

getRowId is the application's own key (a renderer passes true when the app set getRowId), so rows are addressable without a primaryKey column and edit-no-primary-key is not reported. Default false.