CheckboxColumn extends SpreadsheetColumn
Boolean column for Spreadsheet. Renders a bound checkbox (via Input) reflecting the value; activating the cell (click / Enter / type) toggles it inline instead of opening a floating editor.
Binding through Input (rather than a static checkbox) means the column works for a
plain boolean attribute and for any value the binding understands — e.g. a record whose
attribute is a reactive State: the bound checkbox reads it via == true (coercing the
State by valueOf), writes through the record's setter, and reflects external changes
reactively.
Constructor
new CheckboxColumn()
options
:
Object
optionalattribute
:
string
optionalrecord key this column reads/writes
editable
:
boolean
optionalwhether cells can be edited/pasted into
input
:
Object
optionalextra options merged into Input.create (e.g. dump/load)
contextMenu
:
function
optionalhook (menu, cell, column) to augment/replace the right-click menu
index
:
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.
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 Properties
Extra Input.create options merged into every editor (override per type, e.g. number dump).
Input kind passed to Input.create.
MIME types this column accepts on paste.
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).
clear()
Clear the record's value.
Resolve header content.
Build the bound edit control for a record (mirrors Spreadsheet via Input.create).
The returned element is two-way bound to record[attribute] — edits write back on
change/blur — and is shown in a Floater over the cell. Returns null when
the column isn't editable.
Custom editors can take over completion via the session (see Spreadsheet#activateCell):
- keep a key for yourself (e.g. Enter for newlines in a textarea) by calling
stopPropagation()orpreventDefault()on itskeydown - call
session.commit({ move })/session.cancel()to end the edit, orsession.hold(promise)to defer the closing re-render until async work settles
Pick what you need off the session — don't spread it into Input/element options, where its members would become HTML attributes on the editor.
Parameters
record
:
Object
session
:
Object
optionalediting session: { cell, column, record, floater, value, commit, cancel, hold } (value is the typed character seeding a type-to-edit)
Returns
HTMLElement
|
null
Parse a pasted/typed string into the stored value. Override per type.
paste()
Apply a pasted value to the record.
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.
toggle()
Flip the value on activate (toggleable). Reads via == true so a bound value (e.g. a
State, whose getter returns the object) coerces by valueOf rather than reading as a
truthy object; the assignment routes through the record's setter.
Resolve the copy/serialized value for a record (string).