Selection Changed Events
Summary
- AdapTable provides 2 Selection Changed Events:
- Cell Selection Changed - fired whenever the cell or column selection changes in AG Grid
- Row Selection Changed - fired whenever the row selection changes in AG Grid
- Both event provides full details of the selection
Cell Selection Changed
AdapTable fires the Cell Selection Changed Event whenever the Cell selection in AG Grid changes.
This provides very detailed information of all the currently selected Cells and the Columns they are in.
Cell Selection
- This demo illustrates how AdapTable provides information about which cells are selected in AG Grid.
- In the example we listen to the Cell Selection Changed Event and output the results as System Status messages.
- Additionally, if a Single Cell is selected in the
Licensecolumn we highlight the row with a yellow font for 2 seconds (using the Highlighting API functions)
Try It Out
Open the System Status section of the Settings Panel to see full details of the message
Row Selection Changed
AdapTable fires the Row Selection Changed Event whenever the Row selection in AG Grid changes.
Caution
Like AG Grid, AdapTable list all rows that are currently selected, even if they are not part of current Filters
Hint
Use isDisplayed property in the rowInfo property to find just a collection of displayed (i.e. filtered) rows:
api.eventApi.on('RowSelectionChanged', (info: RowSelectionChangedInfo) => {
const rows: GridRow[] = info.selectedRowInfo.gridRows.filter(
gr => gr.rowInfo?.isDisplayed
);
});Row Selection
- This demo illustrates how AdapTable provides information about which rows are selected in AG Grid.
- In the example we listen to the Row Selection Changed Event and output the results as System Status messages.
- We set
ּּּrowSelectiontomode:'multiRow'in Grid Options to allow multiple rows to be selected
Try It Out
Open the System Status section of the Settings Panel to see full details of the message