v7.3.0

GridSelection
Mixin

A mixin for Grid that handles row and cell selection. See selectionMode for details on how to control what should be selected (rows, cells, columns) and how the selection should work.

// select a row
grid.selectedRow = 7;

// select a cell grid.selectedCell = { id: 5, columnId: 'column1' }

// select a record grid.selectedRecord = grid.store.last;

// select multiple records by ids grid.selectedRecords = [1, 2, 4, 6]

See also

No results

Configs

Configs are options you supply in a configuration object when creating an instance of this class

Properties

Properties are getters/setters or publicly accessible variables on this class
  • isGridSelection : Booleantrue
    READONLY
    ADVANCED
    Identifies an object as an instance of GridSelection class, or subclass thereof.
  • In cell selection mode, this will get the cell selector for the (last) selected cell. Set to an available cell selector to select only that cell. Or use selectCell() instead.

  • CSS selector for the currently selected cell. Format is "[data-index=index] [data-column-id=column]".

  • In cell selection mode, this will get the cell selectors for all selected cells. Set to an array of available cell selectors. Or use selectCells() instead.

  • The last selected record. Set to select a row or use Grid#selectRow. Set to null to deselect all

Functions

Functions are methods available for calling on the class
    • getRange( )
      private

      Used internally to get a range of cell selectors from a start selector to an end selector.

    • onStoreDataChange( )
      private

      Triggered from Grid view when the store changes. This might happen if store events are batched and then resumed. Deselects all records which have been removed.

    • Triggered from Grid view when the id of a record has changed. Update the collection indices.

    • onStoreRemove( )
      private

      Triggered from Grid view when records get removed from the store. Deselects all records which have been removed.

    • onStoreRemoveAll( )
      private

      Triggered from Grid view when all records get removed from the store. Deselects all records.

    • selectAll( )
      NON-LAZY-LOAD

      This selects all rows. If store is filtered, this will merge the selection of all visible rows with any selection made prior to filtering.

    Events

    Events are triggered for certain actions in this class and can be listened for to react to those actions in your code

    Event handlers

    Event handlers are callbacks called as a result of certain actions in this class

    Type definitions

    Source path

    Grid/view/mixin/GridSelection.js

    Demo

    examples/selection

    Contents