I’ve been pouring over the Tabulator documentation this evening trying to figure out how to do live range filtering of a numeric column. I have an integer column in my data table that I’d like to subset down to rows where in the integer value falls within a specified range.
I’m assuming, possibly naively, that it should be possible to specify that tuple in a header filter but I’ve not found a way yet to accomplish this. Has anyone else implemented this type of live filtering with Tabulator?
When columns are filtered, an event is generated and inside there is the reference to the headerFilterFunc. It is why there is the error.
For example if the headerFilterFunc is “<=”, you will get the following event: {"events":[{"kind":"ModelChanged","model":{"id":"p1137"},"attr":"filters","new":[{"type":"map","entries":[["field","elevation"],["type","<="],["value","123"]]}]}]}
The event is triggered because panel listen the dataFiltering event of Tabulator. If you build panel and comment the following lines: panel/panel/models/tabulator.ts at main · holoviz/panel
Your code is correct. However, you might have some side effect as panel will not listen anymore the dataFiltering event.
As a patch, you can add cell.getTable().off("dataFiltering") in the 1st line in definition of min_max_editor_code function. This way panel will not listen on the dataFiltering event so Bokeh will not try to serialize a Function.
By using this trick, you will not be able to get the following parameter
filters (list): A list of client-side filter definitions that are applied to the table.