Onsen UI 2 problem with select
I’m using Onsen UI 2.0
I load with $.get a JSON list and then I build a HTML string with all options, then I attach the string in this way:
This is done in the show event.
The problem is that doesn’t work. If I use normal select, it works. If I use ons-select, on Chrome I see all options like text surrounded by <p>, in OS X I don’t see anything.
Can you help me?
@marco3189 Well, you are removing all the previous innerHTML. There was supposed to be a native select inside the
ons-selectbut I guess it’s gone after you set the innerHTML
If you really want to use innerHTML, try to get the
By the way, that was super fast, we just released
ons-select. We are open to suggestions about it
@misterjunio This is one of the problems with the DOM manipulation, it can be unexpected. Perhaps we should force to write a
selectinside or at least provide a way to se its ID with
@Fran-Diox THank you I will try tomorrow and I’ll let you know. One suggestion would be the thing that I’m trying to do: a function that permit to modify the options collection of the select.
@marco3189 We are adding a
select-idattribute so that the inner select element can be accessed dynamically, thanks again for your input
Thank you I’ve tried to as @Fran-Diox suggested but it doesn’t work. Is there a preview channel where I can try this fix?