Tabulator: `headerFilter` is not available

Created on 3 Apr 2019  路  3Comments  路  Source: olifolkerd/tabulator

Describe the bug
Can not create custom headerFilter for column without field.

Tabulator Info

  • Which version of Tabulator are you using? 4.2.3

Working Example
JS Fiddle

To Reproduce

{ 
  headerFilter: true,
  headerFilterFunc: function header_filter( headerValue, rowValue, rowData, filterParams ) { 
  },
},

Expected behavior
I want to create custom column with custom filter
as workaround I add fake field:

{ 
  field: "id",
  headerFilter: true,
  headerFilterFunc: function header_filter( headerValue, rowValue, rowData, filterParams ) { 
  },
},

Desktop (please complete the following information):

  • OS: Linum mint 19.1
  • Browser FFv65
Question - Ask On Stack Overflow

Most helpful comment

Hey @KES777

In your second usage case i would recommend using a mutator to generate a new field that contains the merged data, then using a filter function that checks the values in the two fields seperatly.

Cheers

Oli :)

All 3 comments

Hey @KES777

Interesting use of the header filter there.

I had never really intended the header filters to be used to filter anything other than their current column which is why they were tied to a field name.

But i can see why this may be a useful option in certain circumstances.

The issue it presents itself that there is no meaningful way to send this data back when using ajax filtering.

I would suggest that you make up a field name for your column that isnt represented in your data, that way you can use the header filter.

I hope that helps

Cheers

Oli :)

My use case is next: I do not want to show row's id (because usually it is just a noise), but I want to find rows by ID. For example by IDs from log files.

Currently I use formatter which returns just empty string =)

Also another interesting usecase is when I get from server range data type: [ '2019-01-02', '2019-02-07' )
This one field I display as two columns: From and Till. To filter and edit such columns a bit complex, but possible.

Thanks

Hey @KES777

In your second usage case i would recommend using a mutator to generate a new field that contains the merged data, then using a filter function that checks the values in the two fields seperatly.

Cheers

Oli :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sphynx79 picture sphynx79  路  3Comments

cemmons picture cemmons  路  3Comments

iBek23 picture iBek23  路  3Comments

aditya-thimphu picture aditya-thimphu  路  3Comments

Manbec picture Manbec  路  3Comments