Inject custom filters in render hook TOOLBAR_START
Dear all,
I want to add some custom filter tabs in the table builder on the line left of the search field. They should serve as something like a quick filter for my users.
I found already that the only way to inject something in that place is via render hooks. I was able to successfully add the render hook by injecting the html via a ServiceProvider, like so:
Because I have many different table builders across my application, I would like to add those quick filters not through the central ServiceProvider, but instead right where the Table component is used.
I tried doing it table(), but failed, because nothing like this exists π
Next stop was registering the render hook in mount().
It works, kind of, but it just doesn't feel right.
So my question: Can anybody point me in the right direction? How are you solving this?
Please note: I am using Table Builder as a standalone component, not with full Filament. That removes the option of using this approach: https://filamentphp.com/docs/3.x/panels/resources/listing-records#using-tabs-to-filter-the-records. Also, for layout reasons, I really want to use the space next to the table search bar and not something that goes above the table.
0 Replies