Updating data at runtime #214
Replies: 4 comments 1 reply
-
Hello @jeffgreco13, Could you please clarify what do you mean by "update the data at runtime"? Because, if you set |
Beta Was this translation helpful? Give feedback.
-
Hi @TarekRaafat. Basically, I'm trying to create chained autocomplete fields where the selection in field 1 will change the results in field 2. Here is the Blade component:
Then I include the component like this: The $companyNames PHP variable changes successfully, and I can see the JS variable updating within the page source: However, despite the JS variable updating correctly the autocomplete results still returns the previous data set instead of the updated array. |
Beta Was this translation helpful? Give feedback.
-
@jeffgreco13, you could try updating the data directly into the Please try it and let me know how it goes. |
Beta Was this translation helpful? Give feedback.
-
I believe my solution is just going to involve setting up a route that returns filtered json data. I've moved on to another challenge but I'll post back here once I have a working solution. In the meantime, if anyone using the TALL stack is looking for a Blade component I hope this helps:
Usage: |
Beta Was this translation helpful? Give feedback.
-
Does anyone know of the best way to update the data at runtime?
Currently using the TALL stack (Tailwind, Alpinejs, Livewire, Laravel) and we have a working Blade component, but we're struggling to get autoCompleteJS to observe changes to the array.
Beta Was this translation helpful? Give feedback.
All reactions