Documentation

@kanunilabs/datagrid-react-enterprise


@kanunilabs/datagrid-react-enterprise / UseGridEditingOptions

Interface: UseGridEditingOptions<TRow>

Type Parameters

TRow

TRow = GridRowData

Properties

allowAdding?

optional allowAdding?: boolean


allowDeleting?

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


allowUpdating?

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


appendOnArrowDown?

optional appendOnArrowDown?: boolean

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

The other half of the same data-entry habit: fill a row, press down, keep typing. Also off by default — with it on, a user who holds arrow-down to reach the bottom creates a row when they arrive.


appendOnTab?

optional appendOnTab?: boolean

Tab on the last editable cell of the last row adds a blank row and moves to its first editable cell (P-7.8). Shift+Tab never adds one and stays on the first cell. Needs allowAdding. Default false.


canEditColumn?

optional canEditColumn?: (columnId) => boolean

An extra say on which columns open an editor, on top of the column's own editable: false. The free grid uses it to keep lookup and custom-editor columns read-only — those editors are Enterprise.

Parameters

columnId

string

Returns

boolean


commitOn?

optional commitOn?: CommitOn

cell mode: save each committed cell at once ('cell', default) or the whole row once the user leaves it ('row', P-10) — to another row by any key or click, or out of the grid. A new row left empty is dropped, never sent. Ignored by the other modes.


confirmDelete?

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

Ask before deleting. 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.


controller

controller: DataGridController<TRow> | null


crud?

optional crud?: CrudHandlers<TRow>

Per-row persistence — the app's own insert/update/delete calls.


deleteKey?

optional deleteKey?: boolean

Ctrl+Delete (Cmd+Delete) deletes the focused row (P-7.5): allowDeleting, then the confirmDelete FUNCTION is asked; without a function nothing is deleted. On a row already marked removed (batch) it restores it. Not while an editor is open (the key is the text box's). Default false.


editKeys?

optional editKeys?: EditKeys

Which gestures open an editor (P-7.1): f2, enter, typing, doubleClick. Each left out keeps today's behaviour.


editOnKeyPress?

optional editOnKeyPress?: boolean

Typing a printable key on a focused cell starts editing. Default true.


enabled?

optional enabled?: boolean

Disables editing entirely (editing={{ enabled: false }}).


fillKeys?

optional fillKeys?: boolean

Ctrl+D / Ctrl+R fill down / right over the selection. Default true.


focusCellOnCycle?

optional focusCellOnCycle?: boolean

Tab past the end of a row wraps to the next one. Default true.


focusCellOnTab?

optional focusCellOnTab?: boolean

Tab moves between cells inside the grid instead of leaving it. Default true.


history?

optional history?: boolean

Undo / redo: Ctrl+Z and Ctrl+Y (Cmd on a Mac) and controller.undo(). Default true. The free grid passes false — single-cell editing is Community, history is Enterprise (owner decision, 2026-10-12).


insertKey?

optional insertKey?: boolean | "above" | "below"

Insert opens a blank row next to the focused one: true or 'above' above it, 'below' under it. Default false (off).

Off by default because Insert is not a neutral key: some users have it bound elsewhere, and a grid that starts creating records on a keypress nobody asked for is a surprise. When on, the key is the grid's whenever a cell has focus: it is preventDefault()ed even when no row can be added, so a page-level Insert shortcut does not fire for it (P-7.5).


keepEditingOnTab?

optional keepEditingOnTab?: boolean

Keep the editor open when Tab moves. Default false.


mode?

optional mode?: EditMode


newRowPosition?

optional newRowPosition?: NewRowPosition

Where addRow() puts the new record. Default 'last'.


onInitNewRow?

optional onInitNewRow?: (values) => void

Parameters

values

Record<string, unknown>

Returns

void


onReady?

optional onReady?: (api) => void

Called ONCE when the grid's editing is ready, with the EditingApi (P-1) — the same object controller.editing returns while the grid is mounted. Not called again for a React StrictMode remount or a re-render; the object stays valid across both and turns into a harmless no-op after unmount.

Parameters

api

EditingApi<TRow>

Returns

void


onRowInserted?

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

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>

Parameters

changes

unknown[]

Returns

void | Promise<void>


range?

optional range?: boolean

editing.range — the rectangle, the fill handle and the clipboard gestures (cut / paste). Default true. Off means Ctrl+X and Ctrl+V are left alone too, the same as the vanilla renderer: one switch, all three.


rangePaste?

optional rangePaste?: boolean

Ctrl+V over several selected cells spreads a copied table over them. Default true. false: the paste goes to the focused cell only and the clipboard text is ONE value (tabs and line breaks do not split it).


rowMessages?

optional rowMessages?: boolean

The grid shows a refused save's reason under the row (rowStatus.messages). With commitOn: 'row' a row refused on leave is then reported there only, not also in the "cannot save" dialog. Default false.


rules?

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


savedDuration?

optional savedDuration?: number

How long a row reads 'saved' after its save (engine.getRowStatus), in ms; 0 never shows it. Left out, the engine's default (1500) stays. The grids pass rowStatus.savedDuration, or 0 when rowStatus is off.