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
maybe dispatching the action in the mount method?
What code did you try?
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.maybe this can help you
https://livewire.laravel.com/docs/actions#evaluating-one-off-javascript-expressions
Laravel
Actions | Laravel
A full-stack framework for Laravel that takes the pain out of building dynamic UIs.
Don't mix livewire and filament actions. im talking about filament actions
@DivDax did you find a solution?
1. dispatch event from javascript
2. listen for the event in the livewre component
3. call
$this->mountAction('yourAction')