Custom filtering

Tags: #<Tag:0x00007f2495527158>


We have a table in our app that has completely custom filtering. What this means from HT’s perspective is that the data it receives is already filtered (it follows some very domain specific logic that doesn’t really fit into HT’s filtering system). We have a separate filter panel UI outside the table that controls the filters.

What I would love to be able to do is:

  • Control whether the filter indicator shows on a column (similar to how we can control the sort indicator) even though the HT filter options are not being used
  • Render custom filter UIs inside the dropdown menu. I know I can have a custom text option, but what about a full UI component (in my case rendered through React)?

Hi @abeall

long time no see!

You’re right with those two. I’ve made a resend with my colleague some time ago for the filtering indication (regarding server-side filtering) and at the moment there’s no way to trigger the indicator in any other way than by filtering.
The same goes for the menu, you still would need to pass the label (UI) / callback logic separately.

I just keep coming back :slight_smile:

Thanks for the response. I noticed that the beforeFilter says it can return false:

If hook returns false value then filtering won’t be applied on the UI side (server-side filtering).

That actually sounds like what I want, or is this saying that if you return false it will discard the filter conditions completely so you don’t get a column indicator and when you open the filter dropdown it is reset to default state?

Yes, that was the issue with the indicator that I had on my mind. By returning false we still get the info about the actions (condition stack) but the indicator does not show. We have to trigger the addCondition/filter methods to trigger the indicator.

1 Like