如何关闭特定列的Ag-Grid快速过滤器 [英] How to turn off ag-grid quick filter for specific column

查看:628
本文介绍了如何关闭特定列的Ag-Grid快速过滤器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

AG-grid具有快速过滤器 功能,本质上是一个自由文本搜索过滤器,可以搜索所有列。
问题是,在某些列中,我有日期时间值,并且我不想在这些列中搜索数据。

AG-grid has "quick filter" feature, essentially a free-text search filter that searches through all columns. The problem is, in some columns, I have date-time values and I don't want to search through data in those columns.

使用列 过滤器来分别过滤每列不是一个选择,因为这将给我与的行为:只有当我搜索的所有列都包含我搜索的数据时,此列才可见。而且我需要或行为:包含我在任何列中搜索的数据(具有日期时间值的列除外)的行应该是可见的。

Using "column filter" to filter on each column separately is not an option because this will give me "AND" behavior: only when all columns that I search through contain the data I search for will this column be visible. And I need "OR" behavior: a row that contains the data I search for in any column (except column that has date-time values) should be visible.

所以,如何从快速过滤器搜索通过的列集中删除一些列?

So, how can I remove some columns from the set of columns this "quick filter" searches through?

推荐答案

我只需要设置我不想搜索的列的空函数作为 getQuickFilterText函数:

I just needed to set an "empty" function as "getQuickFilterText" function for the column I don't want to search through:

colDef = {
    getQuickFilterText: () => ''
}

这篇关于如何关闭特定列的Ag-Grid快速过滤器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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