Showing/Hiding buttons based on URL paramaters.
I'm using TrashedFilter and added restore button, but now I want to only show restore button when the value of param tableFilters[Trashed][value] is 0 and I want to dynamically hide/show this button when selecting new value from dropdown. How would I go on about doing this? JS? Got a bit stuck here now.
Same thing for example with DeleteBulkAction button, when I'm on deleted record I want to hide it, since we can't delete the deleted records anymore for example.
Solution:Jump to solution
https://github.com/filamentphp/filament/discussions/5606 Solved with this.
GitHub
Show/hide column based on filter selection · filamentphp filament ·...
My use case is a resource table where I'm displaying in-progress and submitted forms and I have a TernaryFilter, based off a submitted boolean on the Form model, that shows 'All', '...
3 Replies
I didnt test, but guess something like
if ( request()->query->tableFilters[Trashed] )
no, that doesn't work when I change dropdown value, it would work only when I refresh the page first time, but then when I select new value drom dropdown it won't work anymore.
Solution
https://github.com/filamentphp/filament/discussions/5606 Solved with this.
GitHub
Show/hide column based on filter selection · filamentphp filament ·...
My use case is a resource table where I'm displaying in-progress and submitted forms and I have a TernaryFilter, based off a submitted boolean on the Form model, that shows 'All', '...