Previously, I have used this.gridApi.getDisplayedRowCount()
. However, I recently implemented a Master/Detail record structure for one of my grids and I have found that getDisplayedRowCount()
is counting the children Detail records as displayed rows.
For example, if I have a table that contains 10 rows, then this.gridApi.getDisplayedRowCount()
would return 10. Displaying the Details for one of the rows increases that return value to 11.
This isn't behavior that I want, so is there a way to just get the displayed rows, excluding detail rows?
Looking through the gridApi object, I have found a way to do it, but I don't really like that I am accessing nested objects without using the provided API.
this.gridApi.rowModel.rowsToDisplay.filter(row => !row.detail).length;
-> 10