tabulator

Dynamically adapt header filter options to available columns


I'm using Tabulator 4.9 and I have a table with header filters.

When using multiple header filters at the same time, the select component shows options that are not available in the currently filtered rows.

This can be reproduced on the tabulator website:

enter image description here

The menu shows six options although there are only two rows left and the only sensible options would be "red" and "yellow".

I'd love to only show options that actually exist for the currently filtered rows.

I tried supplying a function to the headerFilterParams but it seems like that function is only called once when the table is created, so I couldn't get it to work the way I want.

Any help would be greatly appreciated.

Thanks in advance!


Solution

  • Turns out that newer versions of Tabulator already support this by passing valuesLookup:"active" in editorParams.