- This topic has 4 replies, 2 voices, and was last updated 11 years, 10 months ago by donij.
-
AuthorPosts
-
donijMemberHi All,
I have made attempts to add/remove items from a combobox but without success.
I used jquery as follows;Remove: $(‘#m1-myapp-combo1’).empty();
Add: $(‘#m1-myapp-combo1′).append($(“<option></option>”)
.attr(“value”,’Hello’)
.text(‘Hello’));Need some help.
Thanks
donijMemberHi All,
please I need help cos am stuck here. It is such a simple thing but just don’t know why all the methods applied just didn’t work. I have tried examples on the net but still not working. Even what works for me on my .net app did not work in mobione. This simple one too did not work.
$(“#m1-myapp-combo1”).html(“<option value=’text’>Hello</option>”);
does the screen need refreshing after the add/append/remove?
Please help.
Thanks
donijMemberinterestingly I located the problem. It is quite amazing the naming convention for the html elements generation.
I thought the naming convention for all generated html component id is m1-myscreenname-mywidgetname. I discovered that for my combobox it is different. I walked through the html and what I got is m1-myscreename-hidden-select-mywidgetname. I used this and everything was fine. Will this be different naming convention for other widgets?
The next issue now is after dynamically populating the combobox, the selected item does not appear until I go select it from the list. Any solution please.
Thanks
support-octavioMemberHi donij,
Have you tried the phoneui.preprocessDOM() function after modify your combobox? See a similar question here: http://www.genuitec.com/support-genuitec/viewtopic.php?f=9&t=4323
donijMemberHi Octavio,
thanks a million! it is all working!!
I just pulled this from one of your widgets how-tos. Instruction clearer ;
phoneui.preprocessDOM(‘#screenId’); //force UI to update
Thanks brother.
-
AuthorPosts