ag grid:js:如何查找应用了哪个过滤器 [英] ag grid : js : How to find which filter is applied

查看:154
本文介绍了ag grid:js:如何查找应用了哪个过滤器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在ag网格中显示了数据。
它具有4列名称,年龄,运动,并具有以下数据:-



数据



现在,当我根据运动过滤数据时,可以说取消选中空白
我得到以下数据:-
过滤的数据



1)我的问题是如何将哪个过滤器应用于列,像在这种情况下将 blanks应用于 sport,将
应用于此。 / p>

2)如果我使用
api.setRowdata()刷新数据,则应用于列的过滤器会丢失

解决方案


1。如何获取对列应用哪个过滤器


您可以使用 gridApi.filterManager.allFilters



查看此实时示例 ag-grid:内置过滤器-记录应用的过滤器



应用 age 年份过滤器,然后单击日志过滤器按钮。


age:{列:filter,Promise:承诺,作用域:null,已编译Element:null,guiPromise:{…}}

年:{column:Column,filterPromise:Promise,作用域:null,compiledElement :null,guiPromise:{…}}

__proto__:对象



I have data displayed in ag grid. It has 4 columns name,age,sport and has the following data:-

data

now when I filter the data based on "sport" , lets say uncheck "blanks" I get the following data:- filtered data

1)My questions is how to get the which filter is applied on columns , like in this case "blanks" is applied on "sport".

2)If I refresh the data using api.setRowdata(), filter applied to the columns are lost

解决方案

1.how to get the which filter is applied on columns

You can get it using gridApi.filterManager.allFilters

Check this live example ag-grid: Built-In Filters - log the filters applied.

Apply age and year filters and then click Log Filter button.

age: {column: Column, filterPromise: Promise, scope: null, compiledElement: null, guiPromise: {…}}
year: {column: Column, filterPromise: Promise, scope: null, compiledElement: null, guiPromise: {…}}
__proto__: Object

这篇关于ag grid:js:如何查找应用了哪个过滤器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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