Reputation: 735
I know with the last build of JQuery Mobile there was a bug when adding dynamic checkboxes and I had to assign them all a unique ID and call the .page() on the element in order for them to render properly
When I upgraded to latest Beta 2 build, this does not seem to work anymore.
I tried a few different things, but can not get the checkboxes to render properly when adding them to the page dynamically.
none of these work right: $("input[type='checkbox']").checkboxradio("refresh"); $("input[type='checkbox']").checkboxradio();
and my old bug fix of calling .page() makes it so the checkboxes don't event show up at all.
Upvotes: 0
Views: 823
Reputation: 21
The problem with this jsfiddle is that the label "for" attribute isn't matched with the checkbox id, it's hard-coded to "checkbox-1"
. Change this: for="checkbox-1"
to this: "for="checkbox-'+ counter +'"
Upvotes: 2
Reputation: 75993
I have not yet played around with 1.0b2 however in the blog post about the release the author mentioned a new method of initiating widgets as follows:
$( ...new markup that contains widgets... ).appendTo( ".ui-page" ).trigger( "create" );
That comes from the blog post here: http://jquerymobile.com/blog/2011/08/03/jquery-mobile-beta-2-released/
Here is a jsfiddle of the solution: http://jsfiddle.net/cvxDg/
Upvotes: 1