Selecting Technical Reference

View as Markdown

`## Cell Selection Changed Event

The Cell Selection Changed Event will fire whenever cell (or column) selection in AG Grid changes.

Cell Selection Changed Info

The event contains a single cellSelectionChangedInfo property, of type CellSelectionChangedInfo.

This includes full details of all Selected Cells and Rows in AG Grid:

CellSelectionChangedInfo

Payload of the CellSelectionChanged event.

Fires when the cell selection changes, after AdapTable has updated its selected-cell state. Row selection does not fire this event.

Extends , so adaptableApi is included.

Cells selected after this change. gridCells is empty when nothing is selected.

Custom application Context provided in AdaptableOptions.adaptableContext


Selected Cell Info

The selectedCellInfo property is a SelectedCellInfo object which contains 2 arrays:

SelectedCellInfo

Describes which Cells are currently selected in AdapTable

Array of Columns which have selected cells

Selected cells. Each entry has the cell value, the Primary Key value and the column. Empty when nothing is selected.

The columns property is an Adaptable Column array.

Hint

Use this to see if the Column is ReadOnly or a special type of Column

Grid Cells

The gridCells property is a GridCell array which provides full information about the Selected Cell:

GridCell

Defines a Cell in Adaptable - every cell is an intersection of a Column Id and a Primary Key Value

Column in which Cell is situated

Display value of Cell (e.g. if formatted)

Is Cell in a Pivot Column

Is Cell in a Row Group Column

Normalised value of Cell

Primary Key column's value in row - how Adaptable locates the Cell

Raw value of Cell

rowNode

IRowNode<TData>

AG Grid Row Node that holds the Cell

visible?

boolean

Is Cell in a currently filtered Row


Row Selection Changed Event

The Row Selection Changed Event will fire whenever row selection in AG Grid changes.

Row Selection Changed Info

The event contains a single rowSelectionChangedInfo property, of type RowSelectionChangedInfo.

This includes full details of all Selected Rows in AG Grid:

RowSelectionChangedInfo

Payload of the RowSelectionChanged event.

Fires when the row selection changes, after AdapTable has updated its selected-row state. Cell selection does not fire this event.

Extends , so adaptableApi is included.

Rows selected after this change. gridRows is empty when nothing is selected.

Custom application Context provided in AdaptableOptions.adaptableContext


Selected Row Info

The selectedRowInfo property is a SelectedRowInfo object which contains a single collection:

SelectedRowInfo

Description of currently selected Rows in AdapTable

Array of Grid Rows containing full information about a row in AdapTable

Grid Row

The GridRow object provides full information about the selected row including its underlying data:

GridRow

Detailed information about a Row in AdapTable

Primary Key column's value for Row - how Adaptable locates a cell

rowData?

TData

Actual data in the Row

Object which provides 'meta data' about the Row

rowNode?

IRowNode<TData>

AG Grid Row Node object for the Row

Row Info

The rowInfo property (of type RowInfo) contains a number of very useful boolean properties:

RowInfo

Provides meta data about a Row in Adaptable

isDisplayed?

boolean

Is Row displayed (ie. filtered, not necessarily in viewport)

isExpanded?

boolean

Is Row expanded (if a group row)

isGroup?

boolean

Is Row grouped

isMaster?

boolean

Is Row a Master Row (in a Master-Detail grid)

isSelected?

boolean

Is Row selected

What level the Row is (if Row Grouping is active)

Events Subscription

Subscribing to the 2 Events is done the same as with all Adaptable Events:

api.eventApi.on(
  'CellSelectionChanged',
  (eventInfo: CellSelectionChangedInfo) => {
    // do something with the info
  }
);
api.eventApi.on('RowSelectionChanged', (eventInfo: RowSelectionChangedInfo) => {
  // do something with the info
});