Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SelectionModel

A base class for creating data grid selection models. The namespace for the SelectionModel class statics.

Notes

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

Hierarchy

Index

Type aliases

Static ClearMode

ClearMode: "all" | "current" | "none"

A type alias for the clear mode.

Static CursorMoveDirection

CursorMoveDirection: "up" | "down" | "left" | "right" | "none"

A type alias for the cursor move direction.

Static SelectArgs

SelectArgs: object

A type alias for the select args.

Type declaration

Static Selection

Selection: object

A type alias for a selection in a selection model.

Type declaration

Static SelectionMode

SelectionMode: "row" | "column" | "cell"

A type alias for the selection mode.

Constructors

constructor

Properties

Private _changed

_changed: Signal<this, void> = new Signal<this, void>(this)

Private _selectionMode

_selectionMode: SelectionMode = "cell"

Abstract cursorColumn

cursorColumn: number

The column index of the cursor.

This is -1 if the selection model is empty.

Abstract cursorRow

cursorRow: number

The row index of the cursor.

This is -1 if the selection model is empty.

dataModel

dataModel: DataModel

The data model associated with the selection model.

Abstract isEmpty

isEmpty: boolean

Whether the selection model is empty.

Notes

An empty selection model will yield an empty selections iterator.

Accessors

changed

  • get changed(): ISignal<this, void>

selectionMode

Methods

Abstract clear

  • clear(): void

Abstract currentSelection

Protected emitChanged

  • emitChanged(): void
  • Emit the changed signal for the selection model.

    Notes

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

    Returns void

isCellSelected

  • isCellSelected(row: number, column: number): boolean
  • Test whether any selection intersects a cell.

    Parameters

    • row: number

      The row index of interest.

    • column: number

      The column index of interest.

    Returns boolean

    Whether any selection intersects the cell.

    Notes

    This method may be reimplemented in a subclass.

isColumnSelected

  • isColumnSelected(index: number): boolean
  • Test whether any selection intersects a column.

    Parameters

    • index: number

      The column index of interest.

    Returns boolean

    Whether any selection intersects the column.

    Notes

    This method may be reimplemented in a subclass.

isRowSelected

  • isRowSelected(index: number): boolean
  • Test whether any selection intersects a row.

    Parameters

    • index: number

      The row index of interest.

    Returns boolean

    Whether any selection intersects the row.

    Notes

    This method may be reimplemented in a subclass.

Abstract moveCursorWithinSelections

Protected onDataModelChanged

  • A signal handler for the data model changed signal.

    Parameters

    • sender: DataModel
    • args: ChangedArgs

      The arguments for the signal.

      Notes

      Selection model implementations should update their selections in a manner that is relevant for the changes to the data model.

      The default implementation of this method is a no-op.

    Returns void

Abstract select

Abstract selections

Generated using TypeDoc