Documentation

@kanunilabs/datagrid


@kanunilabs/datagrid / VanillaEditorRenderContext

Interface: VanillaEditorRenderContext<TRow>

What a column's own editor is handed — the React EditorRenderContext, DOM-typed. Same commit/cancel handles the built-in editor uses, so a custom control is a PEER of it rather than something bolted on beside it.

The one shape difference from React is onErrorChange, and it is forced by the medium. React re-invokes renderEditor on every validation change and reconciles the result; a DOM node cannot be re-created that way without throwing away caret position, open dropdowns and any state the control keeps internally. So the editor is built ONCE and subscribes instead.

Type Parameters

TRow

TRow = GridRowData

Properties

cancel

cancel: () => void

Returns

void


columnId

columnId: string


commit

commit: () => void

Returns

void


error

error: string | null

Validation message for value at build time, or null.


onErrorChange

onErrorChange: (listener) => () => void

Called when validation changes; returns an unsubscribe.

Parameters

listener

(error) => void

Returns

() => void


row

row: TRow

The row with pending edits applied — what a cascading list should read.


setValue

setValue: (value) => void

Parameters

value

unknown

Returns

void


value

value: unknown

Current (uncommitted) editor value.