IDataTableHeader

interface
Data Display

Definition of a single column header in <OrigamDataTable> — key, value accessor, title, alignment, fixed pinning, width/minWidth/maxWidth, sorting callbacks, filter function, mobile visibility, and nested children for multi-row headers.

TypeScript

Definition

The TypeScript interface definition as found in the origam source. Click the copy icon to copy the snippet.

typescript

API

Properties

Every property declared by this interface, with its type, optionality and default.

key
'data-table-group' | 'data-table-select' | 'data-table-expand' | TAnyString
Unique column identifier. Reserved values trigger built-in columns (group toggle, row select checkbox, row expand toggle).
value
TSelectItemKey<T>
Accessor for the cell value from the row object. Can be a dot-path string, a function, or an array path.
title
string
Display label in the column header cell.
fixed
boolean
Pins the column to the left edge on horizontal scroll.
align
ALIGN.START | ALIGN.END | ALIGN.CENTER
Horizontal text alignment of all cells in this column.
width
number | string
Fixed width for the column (number = px, string = any CSS length).
minWidth
string
Minimum CSS width for the column.
maxWidth
string
Maximum CSS width for the column.
nowrap
boolean
Prevents cell text from wrapping.
headerProps
any
Extra props/attributes spread onto the <th> element.
cellProps
TDataTableHeaderCell
Extra props/attributes spread onto each <td> cell in this column.
sortable
boolean
Enables sorting on this column. Defaults to true when value is defined.
sort
TDataTableCompareFunction
Custom sort comparator applied to resolved cell values.
sortRaw
TDataTableCompareFunction
Custom sort comparator applied to raw row objects.
filter
TFilterFunction
Custom filter function for this column.
mobile
boolean
Whether this column appears in the mobile stacked layout.
children
Array<IDataTableHeader<T>>
Nested sub-columns for multi-row header spans.

Ecosystem

Used by

Components and composables that extend or consume this interface.

Usage

Examples

Ready-to-paste code snippets using this interface.

Headers with a fixed column and custom sort

typescript