Class DataModelAbstract

An object which provides the data for a data grid.

Notes

If the predefined data models are insufficient for a particular use case, a custom model can be defined which derives from this class.

Hierarchy (view full)

Constructors

Properties

_changed: Signal<DataModel, ChangedArgs> = ...

Accessors

Methods

  • Get the column count for a region in the data model.

    Parameters

    Returns number

    • The column count for the region.

    Notes

    This method is called often, and so should be efficient.

  • Get the data value for a cell in the data model.

    Parameters

    • region: CellRegion

      The cell region of interest.

    • row: number

      The row index of the cell of interest.

    • column: number

      The column index of the cell of interest.

    Returns any

    The data value for the specified cell.

    Notes

    The returned data should be treated as immutable.

    This method is called often, and so should be efficient.

  • Emit the changed signal for the data model.

    Notes

    Subclasses should call this method whenever the data model has changed so that attached data grids can update themselves.

    Parameters

    Returns void

  • Get the merged cell group corresponding to a region and index number.

    Parameters

    • region: CellRegion

      the cell region of cell group.

    • groupIndex: number

      the group index of the cell group.

    Returns null | CellGroup

    a cell group.

  • Get the count of merged cell groups pertaining to a given cell region.

    Parameters

    Returns number

  • Get the metadata for a cell in the data model.

    Parameters

    • region: CellRegion

      The cell region of interest.

    • row: number

      The row index of the cell of interest.

    • column: number

      The column index of the cell of interest.

    Returns Metadata

    The metadata for the specified cell.

    Notes

    The returned metadata should be treated as immutable.

    This method is called often, and so should be efficient.

    The default implementation returns {}.

  • Get the row count for a region in the data model.

    Parameters

    • region: RowRegion

      The row region of interest.

    Returns number

    • The row count for the region.

    Notes

    This method is called often, and so should be efficient.