sqlite - Dynamically adding options to a jQuery Mobile Optgroup -


I'm having trouble connecting an option dynamically I currently have an optog with some hardcode values ​​of HTML :

  & lt; select id = "opt1" multiple = "multiple" data-base-menu = "wrong" data-icon = "grid" data-iconos = "left" & gt; & Lt; optgroup label = "optgroup option" id = "op" & gt; & Lt; Option value = "option1" & gt; Option 1 & lt; / Options & gt; & Lt; Option value = "option 2" & gt; Option 2 & lt; / Options & gt; & Lt; / Optgroup & gt; & Lt; / Select & gt;   

I would like to add this option to my database dynamically. Currently I'm trying to do this like this:

  db.transaction (function (transaction) {transaction.executeSql (input input input input from input 'input = =' '', ' [], Function (transaction, result) {if (result! = Null & amp; result.ro! = Null) {for (var i = 0; i & lt; result.roxt; i ++) {var row = result.rows AdAndend ('& lt; option & gt;' + row ['input'] + '& lt; / option & gt;');}} $ ("# op"). ). Selectmenu ('Refresh');}, errorHandler);}, Error Handler, Null Handler);   

However, this option is not adding correctly, the option only appears on the selection menu and when I click on the menu to see the option, it does not have its own checkbox Any ideas that are not displayed at all?

You're just saying selectmenu ('refresh') on the wrong dome element. You should call him if he does not choose the option group. Then change this line:

  $ ("# opt"). Selectmenu () Selectmenu ('Refresh');   

to

  $ ("# opt1"). Selectmenu ('Refresh');   



Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -