@jsvision/datagrid / CellEditorSpec
Interface: CellEditorSpec
Defined in: datagrid/src/cell-editor.ts:81
The declarative editor descriptor a column carries. Only kind is required; the remaining fields apply to specific kinds — values to enum, items to lookup, create to custom, and validator to override a numeric kind's built-in keystroke filter.
Example
import type { CellEditorSpec } from '@jsvision/datagrid';
const boolSpec: CellEditorSpec = { kind: 'boolean' };
const enumSpec: CellEditorSpec = { kind: 'enum', values: ['open', 'paid', 'shipped'] };
const lookupSpec: CellEditorSpec = { kind: 'lookup', items: [{ key: '7', label: 'Ada' }] };Properties
create?
readonlyoptionalcreate?: (field,host) =>View|null
Defined in: datagrid/src/cell-editor.ts:91
The factory for kind: 'custom' — returns a View bound to field, honoring Enter=commit/Esc=cancel.
Parameters
field
Signal<string>
host
Returns
View | null
items?
readonlyoptionalitems?:LookupProvider
Defined in: datagrid/src/cell-editor.ts:89
The rows for kind: 'lookup' (a static array or an async provider).
kind
readonlykind:CellEditorKind
Defined in: datagrid/src/cell-editor.ts:83
Which typed editor the cell mounts.
validator?
readonlyoptionalvalidator?:Validator
Defined in: datagrid/src/cell-editor.ts:85
Live keystroke filter (defaults per kind; overrides the built-in default when set).
values?
readonlyoptionalvalues?: readonlystring[]
Defined in: datagrid/src/cell-editor.ts:87
The value set for kind: 'enum' — rendered in order; selecting one commits that string.