DataGridRow

Row controller for a DataGrid.

A standalone, persistent plain class — one per data row — mirroring the DataGridColumn controller pattern (a controller object, not itself an element). It is the source-of-truth object for a row and serves as the row handle: code may hold it whether or not the row is on-screen.

It owns its measured height (null until measured — mirroring how a column owns width), so heights travel with the record across sorts/splices. The dumb, pooled row element is referenced as this.element only while windowed; the cumulative offset is read from the grid's rowGeometry, not stored here.

Constructor

new DataGridRow(options)
options : Object
grid : DataGrid
index : number

0-based position in grid.rows

record : *

Instance Properties

Cumulative top offset (px) in body space — read from the grid's rowGeometry.

Instance Methods

Apply the grid's optional rowClass function to the row element. rowClass(record) may return a string, an array of tokens, or a State (coerced to its current value by dolla). Re-evaluated each mount; cleared on unmount so pooled elements don't carry a stale class.

The live cell element for a column (by identity), or null when off-screen.

Measure the (auto-height) row element and record it on the controller. Returns true if the height changed (so the grid can reflow geometry).

Mount (or reposition) this row into the grid body.

Position via transform (no layout cost beyond the transform).

Build and attach this row's cells. When the grid is batch-loading records (loadRecords), the row first renders the grid's loadingRow content and waits for its batch (this.loading, assigned by the grid's windower) to settle.

Resolve (and memoize) the record a column reads/writes for this row. With a column record resolver this is a sub-record (e.g. this row's TIM → its Trait); otherwise it's the row record itself. Resolved once per (row, column) and cached for the row controller's lifetime, so render / edit / copy / paste / clear share one instance — and a resolver that lazily creates a record (… || new Trait(...)) yields one stable instance per cell, not a fresh one per call. May be a Promise (async resolver).

Detach: return cells + the row element to their pools and drop references.