showing external options
Once the user enter the place id i want the name, price and options to be filled
I did the name and price part but I couldn’t figure it out with option (it’s a part of json array coming from a repeater called “options” containing option (what i want) and price)
11 Replies
So you want to change the options not the value? Then you need to do that via the options method. Use a closure and load them inside the closure. You can use
$get
there tooNope, no changes i want the user to be able of seeing the options
Well, what did you do? Share your code
Same code above, after entering the id the user should be able to see the options (name) from options in Place class and select
Um, so why didn't you try what I recommended?
I did but it’s showing “Call to a member function options() on array” ( i want to get only option name from the options array to select )
it is always better to copy the code and add it here with the correct formatting ofc
so we can copy and paste code and tell you what to do
I don't want to write your code again 🙂 it's too long and I am lazy 🤷♂️
anyway your options is array so do
['options']
instead of ->options
try this one, but I hope you understand the changes I made and why 🙂
also I hope it will work
You should add this to the select. Not to a random array that doesn’t have that method.
And remove your
$set('options'
logic from afterStateUpdated“Cannot access offset of type string on string”