I have been successful in adding list items of <li> to a unordered list ul. But now it seems I am having trouble adding checkbox items to a list which is within one <li>. In my jsfiddle below
- I empty the list
- Append to the list
- Refresh the list to add the jqm class styles
Again this has worked in the past for adding list items to a list.I am sure my syntax is just wrong.
This line:
Should change to:
You have to initialize any widget that you add dynamically. Basically you’re telling jQuery Mobile that you have added a widget and you want it to be styled. You were updating the
listviewwidget but not initializing the newcheckboxwidgets.Docs: http://jquerymobile.com/demos/1.1.0-rc.1/docs/forms/checkboxes/methods.html
Here is an updated version of your JSFiddle: http://jsfiddle.net/jasper/N7Z9e/1113/