Describe the bug
Can not create custom headerFilter for column without field.
Tabulator Info
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):
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 :)
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 :)