How to get the number of filtered rows in ag-Grid?

牧云@^-^@ 提交于 2019-12-13 15:19:09

问题


I have an ag-Grid with filtering option.

How to get the number of filtered rows without using forEachNodeAfterFilter callback?

I want to enable a button only if there is a filtered row, and i don't want to perform a foreach loop in the background every time.


回答1:


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




回答2:


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.



来源:https://stackoverflow.com/questions/43542998/how-to-get-the-number-of-filtered-rows-in-ag-grid

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!