如何获取ag-Grid中过滤的行数? [英] How to get the number of filtered rows in ag-Grid?

查看:467
本文介绍了如何获取ag-Grid中过滤的行数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 ag-Grid ,带有过滤选项。

I have an ag-Grid with filtering option.

如何在不使用 forEachNodeAfterFilter 回调的情况下获取过滤的行数?

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

我想要仅当存在过滤的行并且我不想每次在后台执行foreach循环时才启用按钮。

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.

推荐答案

gridOptions.api.getModel().rootNode.childrenAfterFilter.length

您应该查看 rootNode 下还有哪些可用的东西,有一些可能对您有用的数组

You should check out what else is available to you under rootNode, there are a few arrays that might be useful to you

这篇关于如何获取ag-Grid中过滤的行数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆