primefaces global filter without the column filters

限于喜欢 提交于 2019-12-30 04:01:04

问题


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:

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?

回答1:


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

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




回答2:


or you can just put:

.ui-column-filter{
     display: none !important;
}

in your .css to hide all column filters



来源:https://stackoverflow.com/questions/10701841/primefaces-global-filter-without-the-column-filters

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