@kanunilabs/datagrid-react / DataGridCoreConfig
Interface: DataGridCoreConfig<TRow>
Type Parameters
TRow
TRow = GridRowData
Properties
animateRows?
optionalanimateRows?:boolean
Rows glide to their new place when a sort, a filter, a grouping or a data change reorders them (G-CORE-04), instead of jumping. Rows that come into view fade in. Off by default; off as well whenever the system asks for reduced motion.
ariaLabel?
optionalariaLabel?:string
The grid's accessible name: what a screen reader says when focus enters
it ("Orders, grid"). Without it the grid is named by gridId, which is
an identifier rather than words — give every grid on a page its own,
in the page's language. Read by both renderers.
asyncTransactionWait?
optionalasyncTransactionWait?:number
Milliseconds applyTransactionAsync waits before applying a batch
(gap analysis P3.6). Default 50 — about three frames.
Raise it for a feed that ticks faster than the eye can follow; the grid then repaints less often and each pass carries more. Lower it only if the grid must visibly track something else on screen tick for tick.
columns
columns:
GridColumnDef<TRow>[]
dataSource
dataSource:
TRow[] |DataSource<TRow>
debugMode?
optionaldebugMode?:boolean
Console diagnostics for integration mistakes (duplicate keys, unknown columns…).
defaultColumnDef?
optionaldefaultColumnDef?:Partial<GridColumnDef<TRow>>
getRowHeight?
optionalgetRowHeight?: (node,index) =>number|undefined
Per-row height, in px. Return undefined for the standard height.
OPT-IN, and deliberately so: supplying it means the grid asks about every
row in the view on every projection, which on a million rows is a million
calls per filter keystroke. Leave it off and row geometry stays one
multiplication — see RowHeightIndex. Detail panels and the edit form do
NOT need this; they carry their own height.
For heights that depend on how text wraps, prefer autoHeight on the
column: the adapter measures what it rendered instead of asking the app to
predict it.
Parameters
node
RowNode<TRow>
index
number
Returns
number | undefined
gridId
gridId:
string
grouping?
optionalgrouping?:GroupingConfig
locale?
optionallocale?:string
Locale for collation, date handling AND the interface language. Default
'en'. One of the twelve the grid ships (GRID_LOCALES); a regional tag
narrows to its base (de-AT → de), and anything unknown falls back to
English rather than failing to render.
masterDetail?
optionalmasterDetail?:MasterDetailConfig<TRow>
Expandable detail panels under rows. Enterprise (P9).
messages?
optionalmessages?:Partial<GridDictionary>
Override individual strings without replacing the language.
Merged over the resolved dictionary, so an app can rename "Actions" to its own wording in every language while leaving the other 250 alone.
onRowLeaving?
optionalonRowLeaving?: (from,to) =>boolean|Promise<boolean>
Asked before focus leaves a row for another row (or for none), by any
road: a click, the arrow keys, Tab, Enter, focusCell / focusRow /
moveFocus / clearFocus. Return false to stay on from — the move does
not happen and neither does the click's selection. Return a Promise to
decide later (a server check, a "Save changes?" dialog): focus stays on
from until it settles, true then makes the move, and other moves asked
for meanwhile are refused. Moving inside a row does not ask. A row that
leaves the view (filtered, deleted) is not asked about. Delphi's
BeforePost / OnCanFocusRecord.
Parameters
from
RowLeavingSide<TRow>
to
RowLeavingSide<TRow> | null
Returns
boolean | Promise<boolean>
pagination?
optionalpagination?:PaginationConfig
remote?
optionalremote?:RemoteConfig
Tuning for a remote DataSource (ignored for array data).
rowHeight?
optionalrowHeight?:number
The STANDARD row height in px. Default 28.
rowKey
rowKey:
RowKeyResolver<TRow>
REQUIRED: stable row identity — selection, editing and live updates hang off it.
rowPinning?
optionalrowPinning?:boolean|RowPinningOptions<TRow>
Let the user pin rows from the row menu (G-CORE-05). true offers "Pin row
to top" / "Pin row to bottom" on every data row; isRowPinnable narrows
that. See pinRow() for what a pinned row is.
rowStatus?
optionalrowStatus?:boolean|RowStatusOptions<TRow>
Show each row's save state: a thin bar at the row's leading edge — amber
while it has unsaved changes, blue while its save is in flight, green for
a moment once saved, red when the save was refused — and, with tint, a
light wash over the whole row. Free (Community) in both renderers.
Screen readers hear it too (aria-description; aria-busy while saving,
aria-invalid after a refusal).
The grid's own status follows editing (every mode, onSave and
crud); get lets an app that saves elsewhere supply it instead, and
works without editing. Colours: --dg-row-status-changed, -saving,
-saved, -error; width --dg-row-status-width. Off unless passed.
scrolling?
optionalscrolling?:ScrollingConfig
Virtual (default) or infinite scrolling.
searchFold?
optionalsearchFold?:LookupMatchFold
How the quick search (the toolbar box, setSearchText) and the find bar
fold text before comparing — and mark it — in the lookup editors'
matchFold modes. Default 'case': case, and İ I ı i are one
letter. 'tr-loose' also drops the marks of ç ş ğ ö ü â î û, so
"siparis" finds "Sipariş". Client data only: a server grid receives the
search text as typed and folds it itself. Change it later with
controller.setSearchFold.
selection?
optionalselection?:SelectionConfig<TRow>
sorting?
optionalsorting?:SortingConfig<TRow>
summaries?
optionalsummaries?:SummaryDef<TRow>[]
Footer totals over the filtered rows.
tree?
optionaltree?:TreeDataConfig<TRow>
Hierarchical rows (Enterprise, P1.4): each row points at its parent, the
grid renders the tree. Mutually exclusive with grouping — tree wins and
grouping is ignored (reported under debugMode). Client row model only.
viewportDatasource?
optionalviewportDatasource?:ViewportDatasource<TRow>
A server that PUSHES the rows on screen (G-ROW-02, Enterprise): the grid
says which rows are visible, the source sends them — and every change to
them — whenever it likes, the way a price feed works. Takes the place of
dataSource (pass [] there). The source owns the order: the grid's sort,
filter and search reach it through setQuery. Rows cannot be grouped, and
an export holds the rows on screen. See ViewportDatasource.
virtualization?
optionalvirtualization?:VirtualizationConfig
worker?
optionalworker?:WorkerConfig