Form Select options reload
Is there a way to send an event to a form select component to reload its options ? Or do I have to registerListeners for this specific select
8 Replies
How are you triggering the event?
A normal listener with $refresh should work?
My question is how to trigger such event, and a form field is not a livewire component, so I can't trigger a $refresh on a field but on the livewire component which contains the select field.
https://laravel-livewire.com/docs/2.x/events trigger from js/alpinejs, then $refresh on the livewire component
Livewire
Events | Livewire
A full-stack framework for Laravel that takes the pain out of building dynamic UIs.
Something like this?
thanks, I will give it a try
listeners arent gonna do anything here
the options are stored in js
if you pass a callback to options(), the select should refresh them each time you open it
Great! Thanks Dan
my bad, it is true