Replies: 1 comment 2 replies
-
im not sure if this is actually representative of your real code, but your x-inits are strange. You don't need the timeout, and you could actually put it directly on the select elements themselves with just It looks like you need to tell it to reinitialize after the new options are added to the page, though. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, Thanks for the great AlpineJS features. I am kind of new into AlpineJS (And Livewire) and i have a situation where i am implementing a form , where i have among everything else, an interesting situation where i set 2 Select fields as TomSelect Fields with x-init, and i want on select (change) on first one , to be able to populate second one with options dynamically.
To keep TomSelect in charge, i set parent div-s to be
wire:ignore
.i made some Playground for this:
https://laravelplayground.com/#/snippets/6ff8f186-51d1-43ef-8fb8-070c09fe3d26
Now what confuses me is , how to map the
locations
TomSelect and how to refresh data based on what is select into Companies pull-down?I tried
@entangle('companyLocations')
but no luck.Beta Was this translation helpful? Give feedback.
All reactions