jquery - JqueryMobile radiobutton horizontal group does not render properly -
i'm trying programmatically create group of radio-buttons in jquerymobile. works fine except data-type='horizontal'
property:
as can see in this fiddle, "created-via-js" radio group not render properly, while other 1 (written directly html) works great.
i'm following horizontal group example can find on this page
this code:
html
<div id="container"></div>
js
for (var x = 0; x < 2; x++) { var rowlist1 = '<fieldset data-role="controlgroup" data-type="horizontal">' + '<legend>this not render properly..</legend>' + '<input name="radio-choice-h-2" id="radio-choice-h-2a" value="on" checked="checked" type="radio">' + '<label for="radio-choice-h-2a">one</label>' + '<input name="radio-choice-h-2" id="radio-choice-h-2b" value="off" type="radio">' + '<label for="radio-choice-h-2b">two</label>' + '<input name="radio-choice-h-2" id="radio-choice-h-2c" value="other" type="radio">' + '<label for="radio-choice-h-2c">three</label>' + '</fieldset>'; $("#container").append(rowlist1); } $("input[type='radio']").checkboxradio().checkboxradio("refresh");
what doing wrong? idea?
thanks in advance, best regards
try triggering create
method on parent container , not directly on inputs, example
$('#container').trigger('create');
Comments
Post a Comment