@kanunilabs/datagrid-react / GridRowProps
Interface: GridRowProps<TRow>
Type Parameters
TRow
TRow = GridRowData
Properties
ariaSelectable?
optionalariaSelectable?:boolean
Whether the row tells a screen reader its selection state
(aria-selected). Off where rows cannot be selected — a grid without
selection, a pinned row — so the reader does not say "not selected" on
every one. Default true.
centerColumns
centerColumns:
ReactColumnRuntime<TRow>[]
Center columns inside the horizontal window.
centerIndices?
optionalcenterIndices?: readonlynumber[]
True index in layout.center for each rendered center column.
A column's position in centerColumns is NOT its position in the grid —
the block is a window slice with scrolled-past sticky columns spliced onto
the front. Deriving the index from the loop counter made every center
column report a smaller aria-colindex the further right the grid was
scrolled, and put the range anchor and fill handle on the wrong column.
checkboxColumn
checkboxColumn:
boolean
Renders the leading checkbox cell.
columnModel
columnModel:
ColumnModel<TRow>
detailColumn?
optionaldetailColumn?:boolean
Render a leading expander cell for master-detail (Enterprise).
detailExpanded?
optionaldetailExpanded?:boolean
Whether THIS row's detail panel is open.
dropSide?
optionaldropSide?:"before"|"after"|null
Which edge to draw the drop line on, or null.
findKind?
optionalfindKind?: (rowKey,columnId) =>"active"|"match"|null
Find without filtering (P-FIND-01): how a cell takes part — the current
match, another match, or not at all. findStamp changes whenever the
marks do, so the memoised row redraws.
Parameters
rowKey
columnId
string
Returns
"active" | "match" | null
findStamp?
optionalfindStamp?:string
focusedColumnId
focusedColumnId:
string|null
Column id holding keyboard focus in this row, or null.
getCellClassName?
optionalgetCellClassName?: (ctx) =>string|undefined
Parameters
ctx
CellSlotContext<TRow>
Returns
string | undefined
getNote?
optionalgetNote?: (rowKey,columnId,row) =>string|null|undefined
This cell's note, or null (gap analysis P3.3). Only the MARKER is decided here — the text itself is revealed by the tooltip layer, which reads the same source at hover time.
Called once per rendered cell, so the config's get has to be a lookup.
Parameters
rowKey
columnId
string
row
TRow
Returns
string | null | undefined
getSpan?
optionalgetSpan?: (rowIndex,columnId) => {height:number;kind:"draw";offset:number; } | {kind:"covered"; } |null
How this row takes part in a merged block for a column (gap analysis P3.1), or null when the column does not merge here.
Resolved by the caller: deciding it needs the run list AND the window's
bounds, and the row knows neither. height is already in pixels because
only the caller can ask the engine what the covered rows really measure —
an autoHeight row in the middle of a block is not rowHeight tall.
Takes the row index rather than arriving pre-bound to it. A closure per row
defeats this component's memo, and with an autoHeight column that turns
into a measure/re-render loop React ends with "Maximum update depth
exceeded".
Parameters
rowIndex
number
columnId
string
Returns
{ height: number; kind: "draw"; offset: number; } | { kind: "covered"; } | null
gridId
gridId:
string
Used to build stable cell ids for aria-activedescendant.
groupDisplay?
optionalgroupDisplay?:"fullWidth"|"aligned"|"column"
grouping.display: 'aligned' draws a group row as cells, its name in
the first visible column and each summary under its own column.
groupSelection?
optionalgroupSelection?:"all"|"some"|"none"
A group header's checkbox state — its rows all, some or none selected. Absent: no checkbox (single selection, or no checkbox column).
headerRowCount
headerRowCount:
number
Number of non-data rows above (header, and the filter row when shown).
height?
optionalheight?:number
This row's own height, when it is NOT the standard one — a measured
autoHeight row, or one getRowHeight sized.
Undefined means standard, and undefined is the case worth optimizing: the
element gets no inline style at all and inherits --dg-row-height, so a
grid with uniform rows renders exactly the markup it did before any of this
existed. Panels do not use this — they carry their height on the node.
index
index:
number
Row's ordinal in the view (drives striping).
layout
layout:
ColumnLayout<TRow>
leadingSpacer
leadingSpacer:
number
Width of the center columns skipped to the left of the window.
lookupLabels?
optionallookupLabels?:LookupLabels<TRow>
The grid's cache of FUNCTION lookup lists (P-5.1): a closed cell shows the
label, not the raw code. One stable object per grid; when a list arrives
it calls refreshCells(), which moves revision.
node
node:
RowNode<TRow>
onCellDoubleClick?
optionalonCellDoubleClick?: (ctx) =>void
Parameters
ctx
CellSlotContext<TRow>
Returns
void
onCellMouseDown?
optionalonCellMouseDown?: (node,columnId) =>void
Parameters
node
RowNode<TRow>
columnId
string
Returns
void
onCellPointerDown?
optionalonCellPointerDown?: (ctx,event) =>void
Parameters
ctx
CellSlotContext<TRow>
event
MouseEvent
Returns
void
onCellPointerEnter?
optionalonCellPointerEnter?: (ctx,event) =>void
Parameters
ctx
CellSlotContext<TRow>
event
MouseEvent
Returns
void
onRowClick?
optionalonRowClick?: (node,rowIndex?,event?) =>void
The extra arguments are OPTIONAL on purpose, and ordered to match
onRowContextMenu below. The grid passes them so the adapter can resolve
WHICH CELL was hit (closest('[data-column-id]')) and publish
cellClicked / rowClicked; a caller that only wants the row keeps
passing a one-argument function, which stays assignable.
Parameters
node
RowNode<TRow>
rowIndex?
number
event?
MouseEvent<Element, MouseEvent>
Returns
void
onRowContextMenu?
optionalonRowContextMenu?: (node,rowIndex,event) =>void
Right-click on a data row (row menu).
Parameters
node
RowNode<TRow>
rowIndex
number
event
MouseEvent
Returns
void
onRowDoubleClick?
optionalonRowDoubleClick?: (node,rowIndex?,event?) =>void
Parameters
node
RowNode<TRow>
rowIndex?
number
event?
MouseEvent<Element, MouseEvent>
Returns
void
onRowMouseDown?
optionalonRowMouseDown?: (node,event) =>void
Parameters
node
RowNode<TRow>
event
MouseEvent
Returns
void
onToggleDetail?
optionalonToggleDetail?: (rowKey) =>void
Parameters
rowKey
Returns
void
onToggleGroup?
optionalonToggleGroup?: (groupKey) =>void
Parameters
groupKey
string
Returns
void
onToggleGroupSelect?
optionalonToggleGroupSelect?: (groupKey) =>void
The group header checkbox was clicked.
Parameters
groupKey
string
Returns
void
onToggleSelect?
optionalonToggleSelect?: (node) =>void
Parameters
node
RowNode<TRow>
Returns
void
onToggleTreeRow?
optionalonToggleTreeRow?: (rowKey) =>void
Tree data (P1.4): expand/collapse from the first column's toggle.
Parameters
rowKey
Returns
void
renderCellContent?
optionalrenderCellContent?: (ctx) =>ReactNode
Parameters
ctx
CellSlotContext<TRow>
Returns
ReactNode
renderDetail?
optionalrenderDetail?: (row) =>ReactNode
Panel body for a detail row (Enterprise slot).
Parameters
row
TRow
Returns
ReactNode
renderEditForm?
optionalrenderEditForm?: (rowKey,row) =>ReactNode
Body for an in-grid edit form (Enterprise slot, mode: 'form').
row is undefined for a record that does not exist yet — the form is
still opened, because the alternative is pressing "New row" and seeing
nothing happen.
Parameters
rowKey
row
TRow | undefined
Returns
ReactNode
renderRow?
optionalrenderRow?: (ctx) =>ReactNode
Replace the row's CONTENT with arbitrary markup. The row element itself stays — it carries the height, the aria indices and the click handlers the virtualizer and selection depend on, so a template that owned the whole element would have to reproduce all of it correctly to work at all.
Parameters
ctx
RowTemplateContext<TRow>
Returns
ReactNode
renderRowMessage?
optionalrenderRowMessage?: (rowKey,row) =>ReactNode
rowStatus.messages: the content of a message row (a refused save's
reason and its buttons), for the parent row's key.
Parameters
rowKey
row
TRow
Returns
ReactNode
resolveColSpans?
optionalresolveColSpans?: (node) =>ColSpanPlan<TRow> |null
How this data row's cells span columns (G-CORE-03), or null. Resolved by
the caller — the plan needs the column window — through ONE stable
function for the same reason as getSpan: a closure per row would defeat
the memo.
Parameters
node
DataRowNode<TRow>
Returns
ColSpanPlan<TRow> | null
revision?
optionalrevision?:number
Bumped by controller.refreshCells() (P1.7). Read by nothing — its only
job is to differ, so the row memo lets a re-render through when the DATA
behind a valueGetter changed without the node identity changing.
rowClass?
optionalrowClass?:string
The app's rowClassName for this row (P-8), already resolved: a primitive, so memo holds.
rowDrag?
optionalrowDrag?:RowDragHandlers
Row drag & drop (gap G7). A sticky GRIP is rendered at the row's inline
start rather than a lead column: a third lead column would have to be
threaded through leadColumnWidth, every sticky offset and every
aria-colindex in six components, and this file already warns that those
drifting apart is what desynchronizes header and body.
rowFocused?
optionalrowFocused?:boolean
Highlight this row as the focused one (focusedRow is on).
rowNumber?
optionalrowNumber?:number|null
The number to show, already resolved (see rowNumberAt in geometry).
Resolved by the caller rather than derived from index here, because the
ordinal is NOT the number: group banners occupy view positions, and
pagination offsets the count. A row that computed it itself would have to
know about both.
null means this row is not part of the numbering and gets an empty cell.
Pinned rows are the case: they sit outside the result rather than at a
position in it, and numbering them from their own index made a pinned row
and the first data row both claim to be row 1.
rowNumberColumn?
optionalrowNumberColumn?:boolean
Renders the leading row-number cell (gap analysis P3.5).
rowStatus?
optionalrowStatus?:RowSaveStatus
rowStatus: this row's save state, when it has one.
rowStatusStrike?
optionalrowStatusStrike?:boolean
rowStatus.strike: strike through a 'removed' row's text (P-2).
rowStatusText?
optionalrowStatusText?:string
The words a screen reader hears for rowStatus (aria-description).
rowStatusTint?
optionalrowStatusTint?:boolean
rowStatus.tint: wash the whole row, not only the marker.
searchFold?
optionalsearchFold?:LookupMatchFold
The grid's searchFold: how searchNeedle was folded, and so the cell text.
searchNeedle?
optionalsearchNeedle?:string
Lower-cased search term to mark up inside cell text (gap analysis P2.4).
A PROP rather than a read of the controller, so it takes part in the row memo: when the search changes, the rows that need new markup re-render, and when it does not, they do not.
selectable?
optionalselectable?:boolean
False when selection.isRowSelectable refuses this row: its checkbox is
drawn disabled. Default true.
selected
selected:
boolean
statusColumn?
optionalstatusColumn?:boolean
rowStatus.icons: the leading status column is showing.
stickyInsets?
optionalstickyInsets?:ReadonlyMap<string,number>
Inset per STICKY center column, by id. See RenderGeometry.stickyInsets.
striped
striped:
boolean
summaryDefs?
optionalsummaryDefs?: readonlySummaryDef<TRow>[]
Aggregate definitions rendered inside group headers (Enterprise).
trailingSpacer
trailingSpacer:
number
Width of the center columns skipped to the right of the window.