Documentation

@kanunilabs/datagrid-enterprise


@kanunilabs/datagrid-enterprise / EditingOptions

Interface: EditingOptions<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.


commandColumn?

optional commandColumn?: boolean

Pinned column of icon actions at the end of the grid. Default false.


commandLabels?

optional commandLabels?: Partial<CommandColumnLabels>

Wording for the command column's buttons.


confirmDelete?

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

Ask before deleting. Default: the grid's centred dialog.


confirmDeleteMessage?

optional confirmDeleteMessage?: string

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


crud?

optional crud?: CrudHandlers<TRow>

Per-ROW persistence; any handler here takes precedence over onSave.


editOnKeyPress?

optional editOnKeyPress?: boolean

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


enabled?

optional enabled?: boolean


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. Default true.


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.


formLabels?

optional formLabels?: Record<string, string>

Rename the built-in strings for THIS grid — the React option, same shape. Merged over the locale's dictionary, so a partial object renames what it names and leaves the rest translated.


insertKey?

optional insertKey?: boolean

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


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


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>

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.