SpreadsheetCell extends DataGridCell

The cell element for a Spreadsheet. A focusable identity/styling shell over DataGridCell: selection painting, editing, and keyboard navigation are all driven by the Spreadsheet controller against the row/column model (off-screen cells don't exist, which is why the Spreadsheet's cell-centric model doesn't fit). Its main role is a distinct tag for the CSS selectors / cellSelector; it also reflects the per-record readonly state, which is a property of the cell's binding rather than the selection (see SpreadsheetCell#bind).

Constructor

new SpreadsheetCell()

Instance Properties

The block the cell's rendered content lives in — a plain box with no padding or border of its own, sized by the content.

It exists so that anything wanting to bound the content can do so without shrinking the cell: a cell is a grid item that stretches to its row's track, and capping the cell instead detaches it from that track — its border-bottom stops meeting the row's edge, and (in Spreadsheet) the selection box, which is drawn from the row geometry, no longer matches the cell it outlines. It is also what makes -webkit-line-clamp usable: on a grid item the clamp only draws the ellipsis, while on an ordinary block it limits the box to the lines it kept. See the collapsible plugin, which caps and clamps this element.

Created once per pooled cell and re-attached on render.

Instance Methods

Bind this (recycled) cell to a record and reflect the per-record readonly state.

readonly is a function of (record, column), so it only changes when a pooled cell is re-pointed at a different record — i.e. here, once per record entering the virtual window — not on every selection change. super.bind resets the class list to column.class, so the readonly class is (re)applied afterwards. Only otherwise-editable columns reflect the gate; an editable: false column is already non-editable on its own.

Detach this cell: de-register from its column, wipe all per-binding state so the pooled element is clean, and return it to the grid's cell pool. Mirrors DataGridRow#unmount.