@kanunilabs/datagrid-react-enterprise
@kanunilabs/datagrid-react-enterprise / UseGridEditingOptions
Interface: UseGridEditingOptions<TRow>
Type Parameters
TRow
TRow = GridRowData
Properties
allowAdding?
optionalallowAdding?:boolean
allowDeleting?
optionalallowDeleting?:boolean| ((row) =>boolean)
allowUpdating?
optionalallowUpdating?:boolean| ((row,columnId) =>boolean)
appendOnArrowDown?
optionalappendOnArrowDown?: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.
confirmDelete?
optionalconfirmDelete?: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?
optionalconfirmDeleteMessage?:string
Wording for the built-in prompt. Ignored when confirmDelete is a function.
controller
controller:
DataGridController<TRow> |null
crud?
optionalcrud?:CrudHandlers<TRow>
Per-row persistence — the app's own insert/update/delete calls.
editOnKeyPress?
optionaleditOnKeyPress?:boolean
Typing a printable key on a focused cell starts editing. Default true.
enabled?
optionalenabled?:boolean
Disables editing entirely (unlicensed, or editing={false}).
focusCellOnCycle?
optionalfocusCellOnCycle?:boolean
Tab past the end of a row wraps to the next one. Default true.
focusCellOnTab?
optionalfocusCellOnTab?:boolean
Tab moves between cells inside the grid instead of leaving it. Default true.
insertKey?
optionalinsertKey?:boolean
Insert opens a blank row ABOVE the focused one. Default false.
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. DevExpress spells this the same way.
keepEditingOnTab?
optionalkeepEditingOnTab?:boolean
Keep the editor open when Tab moves. Default false.
mode?
optionalmode?:EditMode
newRowPosition?
optionalnewRowPosition?:NewRowPosition
Where addRow() puts the new record. Default 'last'.
onInitNewRow?
optionalonInitNewRow?: (values) =>void
Parameters
values
Record<string, unknown>
Returns
void
onRowInserted?
optionalonRowInserted?: (key,row) =>void
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>
Parameters
changes
unknown[]
Returns
void | Promise<void>
rules?
optionalrules?:Record<string,ValidationRule<TRow>[]>