@kanunilabs/datagrid-react / GridHeaderProps
Interface: GridHeaderProps<TRow>
Type Parameters
TRow
TRow = GridRowData
Properties
bandOffset?
optionalbandOffset?:number
Height of the band rows above, in px. The header sticks BELOW them rather than at 0 — otherwise scrolling down slides the header up over the bands it belongs to.
centerColumns
centerColumns:
ReactColumnRuntime<TRow>[]
checkboxColumn?
optionalcheckboxColumn?:boolean
Leading select-all checkbox column.
detailColumn?
optionaldetailColumn?:boolean
Leading expander column for master-detail (Enterprise).
draggable?
optionaldraggable?:boolean
Make headers draggable onto the group panel.
filteredColumns?
optionalfilteredColumns?:string[]
Column ids that currently have a filter (funnel shown as active).
filterIconMode?
optionalfilterIconMode?:"hover"|"always"
When the funnel is visible. 'hover' (default) keeps the header clean and
reveals it on hover/keyboard focus; 'always' pins it. A column that IS
filtered shows its funnel in both modes — hiding the only indicator that a
filter is active would make rows disappear for no visible reason.
getHeaderClassName?
optionalgetHeaderClassName?: (columnId) =>string|undefined
Extra class names per header cell (a selected column).
Parameters
columnId
string
Returns
string | undefined
groupLevels?
optionalgroupLevels?: readonlystring[]
The grouping levels: the group column (grouping.display: 'column')
shows the direction of the first one, since its click sorts them all.
headerFilter?
optionalheaderFilter?:boolean
Renders the funnel button that opens the distinct-value popup.
layout
layout:
ColumnLayout<TRow>
leadingSpacer
leadingSpacer:
number
onAutoFit?
optionalonAutoFit?: (columnId) =>void
Double-click on the resize handle, and the context-menu "best fit" item.
Parameters
columnId
string
Returns
void
onHeaderClick?
optionalonHeaderClick?: (columnId,event) =>boolean
A click on a header cell, asked BEFORE it sorts. True means the click was taken (Enterprise column selection, G-SEL-02) and the header does not sort.
Parameters
columnId
string
event
MouseEvent
Returns
boolean
onHeaderContextMenu?
optionalonHeaderContextMenu?: (columnId,event) =>void
Right-click on a header cell (Enterprise header menu).
Parameters
columnId
string
event
MouseEvent
Returns
void
onOpenFilter?
optionalonOpenFilter?: (columnId,anchor) =>void
Parameters
columnId
string
anchor
HTMLElement
Returns
void
onReorder?
optionalonReorder?: (columnId,beforeId) =>void
beforeId === undefined means "move to the end".
Parameters
columnId
string
beforeId
string | undefined
Returns
void
onResize?
optionalonResize?: (columnId,width,finished?) =>void
finished is false while dragging, true once on release. Absent = one-shot.
Parameters
columnId
string
width
number
finished?
boolean
Returns
void
onSort
onSort: (
columnId,additive) =>void
Parameters
columnId
string
additive
boolean
Returns
void
onToggleSelectAll?
optionalonToggleSelectAll?: () =>void
Returns
void
renderHeaderLabel?
optionalrenderHeaderLabel?: (columnId) =>ReactNode
Replace a header's label (the Enterprise rename box, G-CORE-06). Undefined = the label.
Parameters
columnId
string
Returns
ReactNode
reorderable?
optionalreorderable?:boolean
Drag a header onto another to change the column order.
resizable?
optionalresizable?:boolean
Drag handle on the trailing edge of each header.
rowNumberColumn?
optionalrowNumberColumn?:boolean
rowNumberHeader?
optionalrowNumberHeader?:ReactNode
What the row-number column's header shows. Defaults to #.
selectAllDisabled?
optionalselectAllDisabled?:boolean
No row in the result can be selected (selection.isRowSelectable).
selectAllState?
optionalselectAllState?:"all"|"some"|"none"
'all' | 'some' | 'none' — drives the tri-state select-all box.
sort
sort:
SortDescriptor[]
sortable
sortable:
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.
trailingSpacer
trailingSpacer:
number