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.
No description
Solution:
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', '...
Jump to solution
3 Replies
btx
btx2d ago
I didnt test, but guess something like if ( request()->query->tableFilters[Trashed] )
lukaveck1
lukaveck1OP2d ago
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
lukaveck1
lukaveck12d ago
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', '...
Want results from more Discord servers?
Add your server