@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.
commandColumn?
optionalcommandColumn?: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?
optionalcommandLabels?:Partial<CommandColumnLabels>
Wording for the command column's buttons (tooltips and screen readers).
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.
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
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 — cxGrid's FocusCellOnCycle.
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 — the cxGrid FocusCellOnTab behaviour.
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.
insertKey?
optionalinsertKey?: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?
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
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.
rules?
optionalrules?:Record<string,ValidationRule<TRow>[]>
Validation rules per column id.