Count number of selected rows in ag-grid

Viewed 4969

I want to count the number of selected rows but it seems onRowClicked or onRowSelected happens before the row i click actually is selected.

How can I count the number of rows when I select a row? I thought this was the way to go.

this.gridOptions.onRowSelected = function (params) {
    console.log(this.gridOptions.api.getSelectedRows().length) 
    // Prints one less then the number of rows that is selected.
}
1 Answers
Related