DataGridColumn
Column controller for a DataGrid.
A standalone, persistent plain class (one per column). It holds column config + behavior and tracks the cells that are currently mounted for this column. Off-screen cells don't exist as DOM, so the full-dataset view is provided lazily via DataGridColumn#cellHandles.
Constructor
new DataGridColumn(options)
options
:
Object
optionalindex
:
number
optional0-based column position (assigned by the grid)
width
:
number
|
string
optionalexplicit column width (px number or CSS px string); falls back to the grid's default width when omitted
frozen
:
boolean
optionalpin this column to the left while the body scrolls
header
:
function
|
string
optionalheader content; function receives (column, grid)
render
:
function
optionalcell content renderer; receives (record, cell, column, grid)
value
:
function
optionaloptional override for the copy/serialized value; receives (record, column). Defaults to the render result.
attribute
:
string
optionalconvenience: when no render is given, read this key off the record
class
:
string
optionalextra class(es) applied to header + cells
unnest
:
function
optionalexpand the record's nested collection into stacked sub-rows for this cell (SQL UNNEST/explode). A function (record) => Array returning the sub-records to stack (read-only display in v1)
splitInto
:
function
optionaldeprecated alias for unnest
record
:
function
optionalresolve the record this column reads/writes from the row's record (e.g. a row TIM → its Trait). A function (rowRecord) => record | Promise<record>. When omitted the column operates on the row's record directly. renderContent/valueFor and (for Spreadsheet) input/paste/clear/toggle all operate on the resolved record.
Instance Methods
cellAt()
A CellHandle for this column at a 0-based row index (or null).
CellHandles for this column across the whole dataset (lazy, transient).
Resolve header content.
Resolve the display content for a record (string / node / dolla descriptor).
Resolve the record this column reads/writes from the row's record. With a record
resolver a cell can edit a sub-record (e.g. a row TIM → its Trait) while the
row stays the row record. Returns the row record unchanged when no resolver is set.
May return a Promise (resolvers are often async); callers await as needed.
Resolve the copy/serialized value for a record (string).