How to get the number of filtered rows in ag-Grid?
gridOptions.api.getModel().rootNode.childrenAfterFilter.length
You should check out what else is available to you under rootNode
, there are a few arrays that might be useful to you
What you are probably looking for is:
gridOptions.api.getDisplayedRowCount()
The actual number of rows after the filtering event is trivially the number of displayed rows.
onFilterChanged(event) {
console.log(gridOptions.api.getDisplayedRowCount());
}
In console the count should be the filtered rows.