primefaces global filter without the column filter

2020-02-28 02:14发布

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: enter image description here

What I want to do is remove the individual column filters and have only the global filter. Like this: enter image description here
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?

2条回答
啃猪蹄的小仙女
2楼-- · 2020-02-28 02:52

or you can just put:

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

in your .css to hide all column filters

查看更多
趁早两清
3楼-- · 2020-02-28 02:58

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...)

查看更多
登录 后发表回答