没有列过滤器的primefaces全局过滤器 [英] primefaces global filter without the column filters

查看:45
本文介绍了没有列过滤器的primefaces全局过滤器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究 primefaces 中提到的例子 showcase.我正在尝试为数据表创建一个全局过滤器.
目前该表如下所示:

I'm working on the example mentioned in primefaces showcase. I am trying to create a global filter for the datatable.
Currently the table looks like this:

我想要做的是删除单个列过滤器并只有全局过滤器.像这样:
为此,我删除了列定义上的 filterBy 属性.但是这样做时,我收到了一个 javascript 警告 - Error in parsing value for filter,声明被删除 并且全局过滤器不起作用.
谁能告诉我如何实现这一目标?

What I want to do is remove the individual column filters and have only the global filter. Like this:
To do that I remove the filterBy attribute on the column definitions. But on doing that, I get a javascript warning - Error in parsing value forfilter, declaration dropped and the global filter doesn't work.
Could someone please tell me how to achieve this?

推荐答案

确保每个 p:column 中都有 filterBy="#{myRowVar.sonmeField}"> (因为全局过滤器需要它)

Make sure you have the filterBy="#{myRowVar.sonmeField}" in every p:column (because the global filter needs it)

并且还在每个 p:column 中添加 filterStyle="display:none"(添加 filterStyle="display:none"将使它不可见...)

And also add the filterStyle="display:none" in every p:column (adding of filterStyle="display:none" will make it not visible...)

这篇关于没有列过滤器的primefaces全局过滤器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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