Documentation

@kanunilabs/datagrid


@kanunilabs/datagrid / CellEditingExtension

Interface: CellEditingExtension<TRow>

What the Enterprise layer adds. Not part of the Community surface: the Community grid never builds one.

Type Parameters

TRow

TRow = GridRowData

Properties

cellAdornment?

optional cellAdornment?: (ctx) => Node | null

Something drawn into a cell that is NOT being edited (the fill handle).

Parameters

ctx

CellSlotContext<TRow>

Returns

Node | null


customEditors?

optional customEditors?: boolean

Honour a column's renderEditor. Default false.


decorateBar?

optional decorateBar?: (bar) => void

Add buttons to the edit strip ahead of the base's (the Add button).

Parameters

bar

HTMLElement

Returns

void


engine?

optional engine?: Partial<EditingEngineOptions<TRow>>

Engine options beyond the Community set — mode, rules, CRUD, permissions.


formLookup?

optional formLookup?: (rowKey, columnId, update) => { allowCustom?: boolean; matchMode?: LookupMatchMode; options: readonly LookupItem[] | null; } | undefined

A form field's lookup list (with the combo box): static lists returned, async ones delivered later through update. Default: the static list, shown read-only by label.

Parameters

rowKey

RowKey

columnId

string

update

(options) => void

Returns

Type Literal

{ allowCustom?: boolean; matchMode?: LookupMatchMode; options: readonly LookupItem[] | null; }

allowCustom?

optional allowCustom?: boolean

matchMode?

optional matchMode?: LookupMatchMode

options

options: readonly LookupItem[] | null

null = loading (dynamic list in flight).


undefined


isColumnEditable?

optional isColumnEditable?: (columnId) => boolean

Column-level editability. Default: the column's editable flag.

Parameters

columnId

string

Returns

boolean


keepEditingOnTab?

optional keepEditingOnTab?: boolean

Keep the editor open when Tab moves. Default false.


onChange?

optional onChange?: () => void

After every engine change and the repaint it requests.

Returns

void


renderLookup?

optional renderLookup?: (spec) => HTMLElement

The lookup combo box builder, for buildCellEditor.

Parameters

spec

CellLookupEditorSpec

Returns

HTMLElement


resolveLookup?

optional resolveLookup?: (rowKey, columnId) => object

The choices for a lookup cell; options: undefined = not a lookup.

Parameters

rowKey

RowKey

columnId

string

Returns

object

allowCustom?

optional allowCustom?: boolean

matchMode?

optional matchMode?: LookupMatchMode

options

options: readonly LookupItem[] | null | undefined