Is there a way to batch select rows in ag-Grid?
Specifically, when I first load data into my grid, I also get from the server a list of rows that should be initially selected. Right now, the only way I know of to select them is to:
this.state.gridApi.forEachNode((node) => {
if (isInitiallySelected(node.data) {
node.setSelected(true);
}
});
However, this fires an oneSelectionChange event for each iteration. This causes some problems in my UI, since I show feedback (a toast) when rows are selected/de-selected.
Is there a way to tell the grid on initial load which rows should be selected?
If not, is there a way via the API to batch-select rows?
If not, is there a way to conditionally silence the onSelectionChange event when doing a node.setSelected() call?