Unable to add form actions to modal
Hi,
I've got a resource with a simple form for creating / editing. I've got a table that displays all the items on the index. Each row in the table has an edit button that opens the edit page in a modal slideover. At the bottom there is a "Save changes" and "Cancel" button.
I'd like to add an additional button to the bottom, but I'm unable to get it to show.
I added the below to my EditItem.php in the Resource Pages directory and the button didn't show.
I also tried
getModalActions
which made no difference.
If I change the page to be a separate page rather than a modal, the button does appear - but that's not what I want.
I'm at a loss, so any ideas welcome.
Thanks3 Replies
I think you need
extraModalFooterActions
https://filamentphp.com/docs/3.x/actions/modals#adding-an-extra-modal-action-button-to-the-footerThanks for the pointer in the right direction. I'm having trouble working out where to put this block though.
Should it be on my table action?
When I do that the type is wrong...
I can't think where else it should be as the modals are generated using
slideOver
and so I've not had to create any actions etc, it's all just worked "out the box"
Thanks
Ahhh - looks like I just needed to namespace the table action.
Thanks!I am trying to achieve almost the same but is there a way to add a simple action button to the modal which excecutes some code without confirming or canceling the modal itself? I would just have a button which triggers an api call but
->action(() => ...)
is not fired but using ->url(...)
does: