Documentation

@kanunilabs/datagrid-react-enterprise


@kanunilabs/datagrid-react-enterprise / EditingOptions

Interface: EditingOptions<TRow>

Type Parameters

TRow

TRow = GridRowData

Properties

allowAdding?

optional allowAdding?: boolean

Show the "New row" command and allow addRow(). Default false.


allowDeleting?

optional allowDeleting?: boolean | ((row) => boolean)

Deletable rows. A predicate decides per row. Default false.


allowUpdating?

optional allowUpdating?: boolean | ((row, columnId) => boolean)

Editable cells. A predicate decides per row and column. Default true.


appendOnArrowDown?

optional appendOnArrowDown?: boolean

Arrow-down on the LAST row appends a blank one. Default false.

The other half of the same habit — fill a row, press down, keep typing. Opt-in for the same reason: with it on, holding arrow-down to reach the bottom creates a row on arrival.


commandColumn?

optional commandColumn?: boolean

Add a pinned column of icon actions at the end of the grid. Default false.

The DevExtreme command column: New row / Save / Discard live in its header, per-row Edit / Delete / Undo in its cells. Off by default because it costs a column of width, which a read-only grid has no use for.


commandLabels?

optional commandLabels?: Partial<CommandColumnLabels>

Wording for the command column's buttons (tooltips and screen readers).


confirmDelete?

optional confirmDelete?: boolean | ((rowKey, row) => boolean | Promise<boolean>)

Ask before deleting a row. Default: a browser confirm.

false deletes straight away. A FUNCTION replaces the prompt with the app's own dialog — return false (or a promise of false) to abandon it.


confirmDeleteMessage?

optional confirmDeleteMessage?: string

Wording for the built-in prompt. Ignored when confirmDelete is a function.


crud?

optional crud?: CrudHandlers<TRow>

Per-ROW persistence — one call per insert/update/delete, which is what a REST or SQL back end wants. Supplying any handler here takes precedence over onSave; a rejection fails the save and leaves the changes pending.


editOnKeyPress?

optional editOnKeyPress?: boolean

Typing a printable character on a focused cell opens the editor with that character, replacing the cell's value. Default true.


enabled?

optional enabled?: boolean


focusCellOnCycle?

optional focusCellOnCycle?: boolean

Tab past the last editable cell of a row wraps to the next row (and Shift+Tab to the previous). Default true — cxGrid's FocusCellOnCycle. With it off, a run of Tabs simply stops at the end of the row.


focusCellOnTab?

optional focusCellOnTab?: boolean

Tab (and Shift+Tab) commits the cell and moves to the next editable one INSIDE the grid, instead of letting the browser tab out of it. Default true — the cxGrid FocusCellOnTab behaviour.


formHeight?

optional formHeight?: number

Starting height in px for the in-grid form (mode: 'form'), before it has been measured. Only worth setting to stop the one-frame resize on open — the real height is measured from the rendered form either way.


formLabels?

optional formLabels?: Partial<EditFormLabels>

Wording for the form/popup editor (mode: 'form' | 'popup') — the buttons, the title and the shortcut hint. User-facing text, so it is translatable.


insertKey?

optional insertKey?: boolean

Insert opens a blank row directly ABOVE the focused one. Default false.

The DevExpress data-entry habit. Opt-in: Insert is a key users may have bound elsewhere, and a grid that starts creating records unasked is a surprise. Ignored while an editor is open, where Insert belongs to the text field.


keepEditingOnTab?

optional keepEditingOnTab?: boolean

Carry the EDITOR along when Tab moves. Default false: the destination cell is focused but not opened, which is the spreadsheet convention — you tab across a row to read it, and start typing only where you mean to.


mode?

optional mode?: EditMode


newRowPosition?

optional newRowPosition?: NewRowPosition

Where addRow() puts the new record: 'last' (default) or 'first'. With a sort active the sort still decides the final position.


onInitNewRow?

optional onInitNewRow?: (values) => void

Seed a row created by addRow(). With a FUNCTION rowKey this is also where the key has to be set — the grid cannot invent one it cannot read.

Parameters

values

Record<string, unknown>

Returns

void


onRowInserted?

optional onRowInserted?: (key, row) => void

Fired after each row-level operation is persisted.

Parameters

key

RowKey

row

TRow | undefined

Returns

void


onRowRemoved?

optional onRowRemoved?: (key, row) => void

Parameters

key

RowKey

row

TRow | undefined

Returns

void


onRowUpdated?

optional onRowUpdated?: (key, row, values) => void

Parameters

key

RowKey

row

TRow | undefined

values

Record<string, unknown>

Returns

void


onSave?

optional onSave?: (changes) => void | Promise<void>

Persist a batch of changes. Rejecting keeps them pending.

Parameters

changes

RowChange<TRow>[]

Returns

void | Promise<void>


range?

optional range?: boolean

Enables range selection, the fill handle and paste. Default true.


rules?

optional rules?: Record<string, ValidationRule<TRow>[]>

Validation rules per column id.