Trigger action from javascript?

In my Livewire component, I have defined an action. Instead of displaying a button in my template, I would like to trigger the action using JavaScript. Is this possible?
6 Replies
LeandroFerreira
maybe dispatching the action in the mount method? What code did you try?
DivDax
DivDaxOP2y ago
I use FullCalendar. When I move an event in the calendar, the eventDrop JavaScript method is called. I want to trigger a delete action via JavaScript before moving or deleting an event.
LeandroFerreira
Laravel
Actions | Laravel
A full-stack framework for Laravel that takes the pain out of building dynamic UIs.
DivDax
DivDaxOP2y ago
Don't mix livewire and filament actions. im talking about filament actions
slamx_
slamx_8mo ago
@DivDax did you find a solution?
DivDax
DivDaxOP8mo ago
1. dispatch event from javascript 2. listen for the event in the livewre component 3. call $this->mountAction('yourAction')

Did you find this page helpful?