How to refresh styles and layout of radio buttons in jQuery Mobile?
I'm using
$("input[type='radio']").checkboxradio("refresh");
to refresh a container of radio buttons. Except when I remove/add a radio button from/to the top or bottom, I do not get rounded corners on the new (top or bottom) radio button.
Here is the jquery ajax function that contains the code for removing a radio button:
$.ajax({
type: "POST",
url: url,
data: data,
dataType: "json",
success: function(resp) {
$("'label[for="+key+"]'").parent().remove();
}
Here is the form:
<form id="test-form">
<div data-role="fieldcontain" id="test">
<fieldset data-role="controlgroup">
<input type="radio" name=开发者_如何转开发"key" id="{{a.key}}" value="{{a.key}}"
<label for="{{a.key}}">{{a.name}}</label>
<input type="radio" name="key" id="{{b.key}}" value="{{b.key}}"
<label for="{{b.key}}">{{b.name}}</label>
<input type="radio" name="key" id="{{c.key}}" value="{{c.key}}"
<label for="{{c.key}}">{{c.name}}</label>
</fieldset>
</div>
</form>
Call .page()
on an element that is a parent of the element that doesn't render correctly.
We'll have to find a way to do it with refresh
精彩评论