Search code examples
javascriptnode.jsnpmtabulator

headerFilterParams without editor


I would like to enable users to filter for predefined keywords (headerFilterParams) with headerFilter. However, the headerFilter example on the Tabulator website also activates a cell editor.

 {title:"Gender", field:"gender", editor:"select", editorParams:{values:{"male":"Male", "female":"Female"}}, headerFilter:true, headerFilterParams:{values:{"male":"Male", "female":"Female", "":""}}},

If I remove the cell editor with editor:"select", editorParams:{values:{"male":"Male", "female":"Female"}},, the keywords in the column header disappear. How can I use headerFilter with headerFilterParams without activating the editor? For now, I passed on empty parameters but that's not really a nice solution because cells still get a blue cell border when selected.


Solution

  • If you don't want an editor in the column don't define the editor property in the column definition.

    Setting the headerFilter property to true causes it to use the same value as the editor property, so in this instance just set the headerFilter property to "select"

    {title:"Gender", field:"gender", headerFilter:"select", headerFilterParams:{values:{"male":"Male", "female":"Female", "":""}}},