Closure on column action doesn't work
Hi, there,
I'm trying to put an action on a column through a closure. I don't want the action to open if there is no
$record->url
, however, as soon as I pass a closure the action doesn't fire at all and the modal never opens.
I've noticed that as soon as I pass a closure in the action, the click event is no longer “mountTableAction” but “callTableColumnAction”.
If anyone has any ideas 😄
Solution:Jump to solution
I think the problem here is that the action isn't getting registered. Try this:
```php
->action(
Tables\Actions\Action::make('show_page_in_modal')
->disabled(fn ($record): bool => ! $record->url)...
4 Replies
Up
Solution
I think the problem here is that the action isn't getting registered. Try this:
Okay, that's how it worked, I hadn't thought of that. Thanks for your help !