@kanunilabs/datagrid-react / ColumnLookup
Interface: ColumnLookup<TRow>
Type Parameters
TRow
TRow = GridRowData
Properties
allowCustom?
optionalallowCustom?:boolean
Let the user type a value outside the list. Default false (closed list).
The editor is the grid's own drop-down (React, P-6): typed text that is
not an item becomes the value on Enter, Tab or leaving the cell; text
equal to an item's label gives that item's value.
autoCompleteSingle?
optionalautoCompleteSingle?:boolean
Whether leaving the editor (Enter, Tab, blur) with typed text completes it
to the one item left, or to the item whose label it equals. Default true
(as before). false is "pick from the list" (K-3, React grids): typing
only filters, a typed code equal to an item's code only HIGHLIGHTS it, an
item is chosen by a click or by highlighting it and pressing Enter, and
text that was not picked is dropped when the cell is left.
dependsOn?
optionaldependsOn?: readonlystring[]
Columns a FUNCTION list depends on (React grids, P-5). The list is called
once per row and these values and kept; without dependsOn it is kept per
row only (and the editor asks again on every open), so give it for every
cascade. When one of these columns is edited and the row's value is no
longer in the new list, the value is cleared (with linkedColumns, the
name and id too): in the same undo step when the function answers with an
array, as a step of its own once a promise settles.
display?
optionaldisplay?:"both"|"code"|"name"
What the box of a code + name list shows, and completes while typing
(typeAhead) against: 'code' (the default), 'name', or 'both'
("K001 — Kavak"). A plain list always shows the label. React grid and
LookupBox (Tekax B.9.1).
dropButton?
optionaldropButton?:boolean
A ▾ button at the box's end that opens and closes the list (Tekax B.4.2). Default false.
hoverHighlights?
optionalhoverHighlights?:boolean
Does the pointer over an item move the highlight that Enter, Tab and leaving write? Default true. False (Tekax B.9.6): the pointer only marks the item; the keyboard's highlight — and what is written — stays.
items
items: readonly
LookupItem[] | ((row) => readonlyLookupItem[] |Promise<readonlyLookupItem[]>)
linkedColumns?
optionallinkedColumns?:LookupLinkedColumns
A code + name pair (React grids, P-5.2): the list shows both, typing
matches either, and picking an item writes value to code, label to
name and id to id in ONE step (one undo step, one save). The name
column is written even when it is editable: false; a locked row writes
nothing. The lookup's own column shows the code, not the label.
listColumns?
optionallistColumns?:LookupListColumn[]
Show the list as a table with a header row: one column per entry, reading
that key of each item ('value', 'label', or any extra field the items
carry, like unit). width in px; left out, the column takes the rest.
Without it a code + name list shows code and name, a plain list the label.
React grid and LookupBox (Tekax B.4.2).
listResizable?
optionallistResizable?:boolean
A grip on the open list's corner: drag it to make the list wider and taller (Delphi's DropDownSizeable, Tekax B.4.3). The size is kept for the column until the page reloads. Default false. React grid.
map?
optionalmap?: (item) =>Readonly<Record<string,unknown>>
More values a pick writes to the row, in the same step (React grids,
P-5.3), e.g. (item) => ({ Birim: item.birim }). Applied after
linkedColumns.
Parameters
item
Returns
Readonly<Record<string, unknown>>
matchFold?
optionalmatchFold?:LookupMatchFold
How typed text and item text are compared (React grids, P-13), for both
'startsWith' and 'contains' and for a code + name list's code and name:
'none' exact characters; 'case' upper/lower case, and İ I ı i count as
one letter; 'case-accent' strict Turkish casing and ç ş ğ ö ü â î û match
c s g o u a i u; 'tr-loose' like 'case-accent' and ı = i, so "isik",
"ISIK" and "cay" find "Işık" and "Çay". Default 'case', which is what
the editor always did.
matchMode?
optionalmatchMode?:LookupMatchMode|LookupMatchModes
How typed text narrows the list. Default 'startsWith'.
Prefix by default because a lookup list is usually a code list, and a code
is read from the left — the user knows how it starts, not what it contains.
'contains' suits lists of prose labels, where the distinguishing word is
rarely the first one. With linkedColumns, { code, name } sets each
field apart; a plain value applies to both.
multiple?
optionalmultiple?:boolean| {bits?:boolean;emptyText?:string;separator?:string; }
Union Members
boolean
Type Literal
{ bits?: boolean; emptyText?: string; separator?: string; }
bits?
optionalbits?:boolean
emptyText?
optionalemptyText?:string
What the cell, the editor box, copy and export say when nothing is picked ("Seçilmedi"). Default ''.
separator?
optionalseparator?:string
onDisabledItem?
optionalonDisabledItem?: (ctx) =>void
lookup.multiple: a press (click, tap, Space) on a disabled item — it is
not ticked; tell the user why (Tekax B.18).
Parameters
ctx
columnId
string
item
row
TRow | undefined
rowKey
Returns
void
onNoMatch?
optionalonNoMatch?:"revert"|"keep-open"
Typed text that picks nothing, on a closed list (React grids, P-5.4).
Either way Enter keeps the editor open and screen readers hear "no
record" (editNoMatch), and blur and Escape restore the old value.
'keep-open' (default, as before): Tab does not leave either.
'revert': Tab drops the text and moves on with the old value.
onPickerOpen?
optionalonPickerOpen?: (ctx) =>LookupItem|Promise<LookupItem|null> |null
A "…" button in the open editor (and Ctrl+Enter there) that opens YOUR
picker — a search dialog over the whole table, say — like Delphi's
ButtonEdit (Tekax B.4.1). Resolve with the chosen item, or null to keep
what is there. The item is written exactly like a pick from the list: with
linkedColumns, code and name together. While it is open, focus leaving
the grid for your dialog does not commit the cell or send the row. React
grid.
Parameters
ctx
LookupPickerContext<TRow>
Returns
LookupItem | Promise<LookupItem | null> | null
openHighlight?
optionalopenHighlight?:"none"|"current"
What is highlighted when the list opens with nothing typed (▾, F4, Alt+Down,
openOnEdit): 'none' (the default) keeps today's rule — the current item
with autoCompleteSingle: false, else the first; 'current' (Tekax,
2026-11-12) the current item, or the FIRST when the box is empty or its
value is not in the list. Enter picks the highlighted item; Tab and leaving
write only an item walked to with the keys.
openOnEdit?
optionalopenOnEdit?:boolean
Open the list the moment the editor opens (React grids, P-11). Default
false: the list opens when the user types, presses Alt+Down or clicks the
box. True: however the editor is opened (Enter, F2, double-click, typing,
startEditingCell) the list is already open. When typing opened it, the
list is filtered by that character, the caret sits after it and the
character is not selected, so the next letter adds to it.
restrictInput?
optionalrestrictInput?:boolean
Refuse typing that matches no item (React grids, P-12), like a fixed-list
combo box. Default false. True: a keystroke, paste or drop whose resulting
text matches no item (by matchMode and matchFold; matchMode.code /
.name for a code + name list) is rejected, the text and caret stay where
they were, and the box briefly gets the kanuni-datagrid-editor--refused
class (no message). Deleting is always allowed. During an IME composition
nothing is rejected; the finished text is checked once. Ignored with
allowCustom.
typeAhead?
optionaltypeAhead?:boolean
Complete while typing (React grids, P-17), like a Delphi lookup combo.
Default false. True: when an item's label STARTS with the typed text the
box shows that label with the added part selected (the next letter
replaces it, Backspace removes it and does not complete again) and the
item is highlighted; when only matchMode: 'contains' matches, nothing is
completed and the first match is highlighted. Enter, Tab and leaving the
cell pick the highlighted item (Tab then moves on); text that matches
nothing picks nothing and the value stays. During an IME composition the
completion waits for the finished word. Ignored with allowCustom.