@kanunilabs/datagrid-react-enterprise
@kanunilabs/datagrid-react-enterprise / EditingOptions
Interface: EditingOptions<TRow>
Type Parameters
TRow
TRow = GridRowData
Properties
allowAdding?
optionalallowAdding?:boolean
Show the "New row" command and allow addRow(). Default false.
allowDeleting?
optionalallowDeleting?:boolean| ((row) =>boolean)
Deletable rows. A predicate decides per row. Default false.
allowUpdating?
optionalallowUpdating?:boolean| ((row,columnId) =>boolean)
Editable cells. A predicate decides per row and column. Default true.
appendOnArrowDown?
optionalappendOnArrowDown?: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.
appendOnTab?
optionalappendOnTab?:boolean
Tab on the last editable cell of the last row adds a blank row at the
bottom and moves to its first editable cell (P-7.8). Default false; needs
allowAdding. With it on, Shift+Tab on the grid's first cell stays there
instead of leaving the grid; it never adds a row. Under
commitOn: 'row' a row added this way and left blank is dropped, never
sent.
batchBar?
optionalbatchBar?:boolean
Draw the grid's own Save / Cancel strip in mode: 'batch'. Default true.
false leaves it out of the DOM entirely — for an app with its own
Save button (call api.saveChanges() / api.cancelChanges()). Pending
edits, the changed-cell marks and rowStatus work the same either way.
commandColumn?
optionalcommandColumn?:boolean
Add a pinned column of icon actions at the end of the grid. Default false.
A common pattern in grid editing UIs: 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?
optionalcommandLabels?:Partial<CommandColumnLabels>
Wording for the command column's buttons (tooltips and screen readers).
commitOn?
optionalcommitOn?:CommitOn
When mode: 'cell' saves (P-10). Default 'cell': every committed cell
is saved at once, as before.
'row': moving between the cells of one row saves nothing; the row goes
as ONE save — one onSave call (or one crud.insert / crud.update)
with all its values — when the user leaves it: to another row (arrow,
Tab past the row's end, Enter, a click, Insert, arrow-down on the last
row) or out of the grid. Until then the row reads changed (new for an
added row) in rowStatus. api.saveChanges() sends it too.
A new row nothing was written into — the values onInitNewRow or
addRow(values) seeded do not count — is dropped instead of sent: on
leaving it, on Escape, on Save. A row whose save is refused (a rule
checked on save, such as required on a column never opened, or the
server) is not sent and reads error, with the reason under the row
under rowStatus.messages; focus is not pulled back to it, and it is not
sent again until it is edited again, retried, or saved with
saveChanges(). Ignored by the other modes.
confirmDelete?
optionalconfirmDelete?: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?
optionalconfirmDeleteMessage?:string
Wording for the built-in prompt. Ignored when confirmDelete is a function.
crud?
optionalcrud?: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.
deleteKey?
optionaldeleteKey?:boolean
Ctrl+Delete (Cmd+Delete on a Mac) deletes the focused row (P-7.5).
Default false. Order: allowDeleting for that row, then confirmDelete,
which must be a FUNCTION here — without one nothing is deleted (the
built-in prompt is not used for the key). On a row already marked removed
(batch) Ctrl+Delete restores it. When the row leaves the grid (cell
mode, an unsaved new row) focus moves to the row below it, else above.
While an editor is open the key is the text box's (deletes the next
word). When on, the key is always preventDefault()ed on a focused cell,
even when nothing is deleted.
editKeys?
optionaleditKeys?:EditKeys
Which gestures open a cell's editor (P-7.1). Each field left out keeps
today's behaviour: { f2: true, enter: false, typing: true, doubleClick: true }.
f2: false— the grid does not handle F2 at all and does notpreventDefault()it; the key reaches the page (an app whose F2 is Save).enter: true— Enter opens the focused editable cell's editor; Enter or Shift+Enter in an open editor commits and STAYS on the cell (instead of moving down). Enter never adds a row. On a cell that cannot be edited Enter is stillonRowActivate.typing: false— typing on a focused cell does not open its editor (same aseditOnKeyPress: false; this one wins when both are given).doubleClick: false— neither a double-click nor a double-tap opens an editor (onCellDoubleClickhandlers of the app still run).
editOnKeyPress?
optionaleditOnKeyPress?:boolean
Typing a printable character on a focused cell opens the editor with that character, replacing the cell's value. Default true.
enabled?
optionalenabled?:boolean
Editing UI on or off. Default TRUE — and the default applies with no
editing prop at all: an EnterpriseDataGrid opens editors and offers
Cut/Paste unless told otherwise (the vanilla twin documents the same
default). A read-only Enterprise grid passes { enabled: false }, which
also turns off range selection, the fill handle and paste.
Written down after field report KL-08 (2026-09-22): a grid rendered
without editing was taken to be read-only, and its Cut/Paste menu
entries to be a bug.
fillKeys?
optionalfillKeys?:boolean
Ctrl+D (fill down) and Ctrl+R (fill right) over the selection. Default
true. false leaves both keys to the page (Ctrl+R: reload) — the fill
handle still works.
focusCellOnCycle?
optionalfocusCellOnCycle?:boolean
Tab past the last editable cell of a row wraps to the next row (and Shift+Tab to the previous). Default true. With it off, a run of Tabs simply stops at the end of the row.
focusCellOnTab?
optionalfocusCellOnTab?: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.
formHeight?
optionalformHeight?: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?
optionalformLabels?: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.
history?
optionalhistory?:boolean
Undo / redo: Ctrl+Z, Ctrl+Y (Ctrl+Shift+Z) and controller.undo() /
redo(), and api.undo() / redo(). Default true. false keeps no
reachable history: the keys are left to the page and the methods answer
false. A successful save takes what it sent out of the history — in
batch everything up to that save, in cell the saved change (no
reverse save is ever sent).
insertKey?
optionalinsertKey?:boolean|"above"|"below"
Insert opens a blank row next to the focused one and opens its first
editable cell: true or 'above' directly ABOVE it, 'below' under it.
Default false (off). Needs allowAdding.
A 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. When on, Insert on a focused cell is always
preventDefault()ed, even when no row can be added, so a page-level
Insert shortcut does not fire for it (P-7.5).
keepEditingOnTab?
optionalkeepEditingOnTab?: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?
optionalmode?:EditMode
newRowPosition?
optionalnewRowPosition?:NewRowPosition
Where addRow() puts the new record: 'last' (default) or 'first'.
With a sort active the sort still decides the final position.
onInitNewRow?
optionalonInitNewRow?: (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
onReady?
optionalonReady?: (api) =>void
Called ONCE when the grid's editing is ready (P-1), with the
EditingApi: hasChanges, getChanges, saveChanges, cancelChanges,
addRow, removeRow, restoreRow, isRemoved, getRowStatus,
getRowStatusError, getErrorRowKeys, effectiveRow, undo / redo,
isDirty, revertRow, revertCell. It is the same object
controller.editing returns while the grid is mounted, the same on every
render, and it survives a React StrictMode remount (no second call).
After the grid unmounts its methods do nothing and do not throw.
Default: not called.
Parameters
api
EditingApi<TRow>
Returns
void
onRowInserted?
optionalonRowInserted?: (key,row) =>void
Fired after each row-level operation is persisted.
Parameters
key
RowKey
row
TRow | undefined
Returns
void
onRowRemoved?
optionalonRowRemoved?: (key,row) =>void
Parameters
key
RowKey
row
TRow | undefined
Returns
void
onRowUpdated?
optionalonRowUpdated?: (key,row,values) =>void
Parameters
key
RowKey
row
TRow | undefined
values
Record<string, unknown>
Returns
void
onSave?
optionalonSave?: (changes) =>void|Promise<void>
Persist a batch of changes. Rejecting keeps them pending.
Parameters
changes
RowChange<TRow>[]
Returns
void | Promise<void>
range?
optionalrange?:boolean
Enables range selection, the fill handle and paste. Default true. With
enabled: false, range: true keeps cell and range selection and Ctrl+C
(what the cells show) on a grid nobody can edit.
rangePaste?
optionalrangePaste?:boolean
Ctrl+V spreads a copied table over the selected cells. 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 over cells. Copy, cut,
selection and the fill handle are unchanged.
rules?
optionalrules?:Record<string,ValidationRule<TRow>[]>
Validation rules per column id.