Actions in table column view not triggering
Hi,
TLDR; Action in table
ViewColumn
doesn't do anything when clicked
I've got a ManageRelatedRecords
page - lets call it "Activity". On my activity page I have a table that displays rows of items that can be of different types. One of the columns is a ViewColumn
and depending on the type, it shows different content in the view.
In that view, I have an action to view more info. I've followed the docs here: https://filamentphp.com/docs/3.x/actions/adding-an-action-to-a-livewire-component#adding-the-action and my action appears on screen, but when I click it, nothing happens.
In my table:
In the ManageRelatedRecords
page I have my action
In my activity-details
view I have
I've spent a while debugging this but I'm at a loss as to why it's not working. Any help appreciated
CheersSolution:Jump to solution
This might be stupid, but can you rename your action to
Action::make('viewMoreDetails')
?7 Replies
What are you trying to get it to do?
if for example you do:
I want it to open a modal that has another view - I was doing
info()
to see if it run
Even with the form, it does nothing
It seems 2 requests are fired in the network tab - one for mountAction and another for close-modal
Which suggests it's closing the modal straight away rather than opening itI wonder whether this has anything to do with it - I'm rendering an action outside a table, but displaying tables on the page. I am including the modals element though: https://github.com/filamentphp/filament/issues/11678
GitHub
Action Modal Would not open · Issue #11678 · filamentphp/filament
Package filament/filament Package Version v3.2.43 Laravel Version v10.46.0 Livewire Version v3.4.6 PHP Version PHP 8.3.3 Problem description Action that suppose to show a modal for user to fill up ...
Solution
This might be stupid, but can you rename your action to
Action::make('viewMoreDetails')
?Well. It only blummin works! 🥳
How bizzare - do you happen to know why that would make a difference?
I believe it's just the naming convention. It doesn't convert from camel case -> pascal etc
So it expects the names to match exactly :
doSomethingCoolAction
-> doSomethingCool
Fair enough - I guess I've just overlooked that and never needed to use actions this way. All of my actions are snake case so
do_something_cool
. I guess it wasn't clear from the docs as they're all 1 word actions like delete / edit etc
Thanks for the help 🙂