Represents a model for handling colspan and rowspan in a table.

Hierarchy

  • ColAndRowspanModel

Constructors

Properties

areaModel: AreaModelIf
colAndRowspanRanges: undefined | CellRange[] = undefined
rowCountAtInit: number = -1

Row count of the area model at the last init (−1: not initialized yet).

tableModel: TableModelIf

Methods

  • Builds the ranges again if the row count of the area model changed since the last init – e.g. after setRows() or a filter (the old ranges could point to rows that no longer exist). Cheap otherwise.

    Returns boolean

    true if the ranges were rebuilt

  • Live data (since 1.1.108): rows were inserted (and maybe removed at the start) – scans only the inserted rows (O(k)) instead of all rows (init: O(n) per update, because most area models report a possible span of 31). Only possible while no span exists; otherwise (or before the first init) false – then initIfRowCountChanged builds the ranges again.

    Parameters

    • insertedPositions: ArrayLike<number>

      display indices of the inserted rows (after the step), ascending

    Returns boolean

    true if the ranges are up to date