Documentation

@kanunilabs/datagrid-react-enterprise


@kanunilabs/datagrid-react-enterprise / GridCellEditorProps

Interface: GridCellEditorProps

Properties

allowCustom?

optional allowCustom?: boolean

Let the user type a value outside options.


ariaLabel?

optional ariaLabel?: string

Accessible name for the editor, used by the lookup combo box.


dataType

dataType: GridDataType | undefined


dateFormat?

optional dateFormat?: string

Format for a date column — governs both the mask and the display.


error

error: string | null

Validation message for the current value; null when valid.


lookupSettings?

optional lookupSettings?: LookupEditorSettings

The rest of the column's lookup as the combo box reads it (P-5 / P-6): code + name, K-3, onNoMatch. Wins over allowCustom / matchMode.


matchMode?

optional matchMode?: LookupMatchMode

How typed text narrows the lookup list. Default 'startsWith'.


multipleLookup?

optional multipleLookup?: ColumnLookup<never>

The column's lookup when it is multiple (B.6): the check-box editor.


numberFormat?

optional numberFormat?: ResolvedNumberFormat

The column's numberFormat (locale resolved): the editor is then a text box in that locale (P-3) whose value is the TEXT; the engine reads it.


numberLocale?

optional numberLocale?: string

The grid's number locale ('tr-TR'), for reading a number box opened by typing - or , on a column without numberFormat. Default 'en-US'.


onCancel

onCancel: () => void

Returns

void


onChange

onChange: (value) => void

Parameters

value

unknown

Returns

void


onCommit

onCommit: (move) => void

'blur': focus left the editor — commit, but do not take focus back.

Parameters

move

"none" | "down" | "blur"

Returns

void


onDisabledItem?

optional onDisabledItem?: (item) => void

lookup.onDisabledItem, bound to the cell (B.18).

Parameters

item

LookupItem

Returns

void


onPick?

optional onPick?: (item) => boolean

A pick that writes more than this cell (code + name, map): true when written.

Parameters

item

LookupItem

Returns

boolean


onPickerOpen?

optional onPickerOpen?: (text) => LookupItem | Promise<LookupItem | null> | null

lookup.onPickerOpen, bound to this cell (B.4.1).

Parameters

text

string

Returns

LookupItem | Promise<LookupItem | null> | null


onTab

onTab: (direction) => void

Tab / Shift+Tab: commit here and keep editing in the adjacent cell.

Parameters

direction

-1 | 1

Returns

void


options?

optional options?: readonly LookupItem[] | null

Choices for a lookup/select editor. null means the list is still being fetched — the control renders disabled rather than empty, so the user cannot commit a blank over a value while the options are in flight.


registerFlush?

optional registerFlush?: (flush) => void

The engine's setEditFlusher (B.12.5): lookup and date editors register their leaving rule.

Parameters

flush

(() => boolean) | null

Returns

void


restore?

optional restore?: object

The cell's value before an editor opened by typing (B.15), for the lookup editor to put back.

value

value: unknown


seeded?

optional seeded?: boolean

The editor was opened by TYPING, so value is the character the user just pressed. The caret goes after it instead of selecting it — selecting would make the second keystroke erase the first.


seedText?

optional seedText?: string

The editor was opened by typing a character that is not a value yet (P-3.6): - or , on a number cell, a digit on a date cell. The box starts with it, caret after it; value stays the cell's own until a complete value is typed.


suspendBlurCommit?

optional suspendBlurCommit?: (on, restoreTo?) => void

The grid's suspendBlurCommit, held while that picker is open.

Parameters

on

boolean

restoreTo?

() => HTMLElement | null

Returns

void


value

value: unknown