1
嗨,我编写简单的应用程序使用jqm和phonegap,我有一些问题与复选框:他们失去了风格后,我添加一些代码.append()这是我的代码。 以html:使用.checkboxradio( “刷新”)dosn`t工作jquery移动复选框丢失风格
function upbConfDep(){
mydb.transaction
(
function(transaction)
{
transaction.executeSql
(
'SELECT `id`, `name` FROM `deposits` WHERE `userId`='+userId+' ORDER BY `name`;',
[],
function (transaction, results)
{
var depostitNumber=results.rows.length,nowRow;
if (results.rows.length>0)
{
for(var i=0;i<depostitNumber;i++)
{
dps=results.rows.item(i);
$('#vklConf').append('<input type="checkbox" name="ch'+dps['id']+'" id="ch'+dps['id']+'" class="custom" />');
$('#vklConf').append('<label for="ch'+dps['id']+'">');
$('#vklConf').append(dps['name']);
$('#vklConf').append('</label>');
}
}
},
DBerror
);
}
);
$("#vklConf").checkboxradio('refresh');
//or $("input[type='checkbox']").checkboxradio("refresh"); dosn`t work
}
upbConfDep();
$('#newPrize').live
(
'pageinit',
upbConfDep
);
:
<div data-role="fieldcontain">
<fieldset data-role="controlgroup" id="vklConf">
<legend>Deposit:</legend>
<input type="checkbox" name="checkbox-1a" id="checkbox-1a" class="custom" />
<label for="checkbox-1a">first</label>
</fieldset>
</div>
和.js文件。 有没有人有想法为什么复选框输入样式?
你是否已经与网页()尝试刷新页面? http://stackoverflow.com/questions/5663033/jquery-mobile-dynamic-checkboxes-lose-style – arthur86 2012-04-24 08:15:12