jquery 动态复选框创建与移动外观
我在移动应用程序中,我想创建一个复选框列表。为此,我使用下面的代码
for (i = 0; i < len; i += 1) {
row = resultflatname.rows.item(i);
if (row.receiptno == 0){
items.push('<input type="checkbox" name="code_'+ i +'" id="code_'+ i +'" value="' + row.amount + '" previous="' + row.pastpayments + '" barcode="' + row.barcode + '" todayp="' + row.todaypayments + '"/><label for="code_'+ i +'">' + row.period +'..........'+ row.amount+'</label>');
} else {
if ((row.receiptno > 0) && (row.amount > row.todaypayments + row.pastpayments)){
items.push('<input type="checkbox" name="code_'+ i +'" id="code_'+ i +'" value="' + row.amount + '" previous="' + row.pastpayments + '" barcode="' + row.barcode + '" todayp="' + row.todaypayments + '"/><label for="code_'+ i +'">' + row.period +'..........'+ row.amount+'</label>');
}
}
list.html('<fieldset data-role="controlgroup">' + items.join('') + '</fieldset>');
和我的 html
<div id="Code" data-role="fieldcontain">
</div>
如何刷新它以便使用移动样式对其进行样式设置???
i am in mobile app and i want to create a checkbox list. To do this i use the below code
for (i = 0; i < len; i += 1) {
row = resultflatname.rows.item(i);
if (row.receiptno == 0){
items.push('<input type="checkbox" name="code_'+ i +'" id="code_'+ i +'" value="' + row.amount + '" previous="' + row.pastpayments + '" barcode="' + row.barcode + '" todayp="' + row.todaypayments + '"/><label for="code_'+ i +'">' + row.period +'..........'+ row.amount+'</label>');
} else {
if ((row.receiptno > 0) && (row.amount > row.todaypayments + row.pastpayments)){
items.push('<input type="checkbox" name="code_'+ i +'" id="code_'+ i +'" value="' + row.amount + '" previous="' + row.pastpayments + '" barcode="' + row.barcode + '" todayp="' + row.todaypayments + '"/><label for="code_'+ i +'">' + row.period +'..........'+ row.amount+'</label>');
}
}
list.html('<fieldset data-role="controlgroup">' + items.join('') + '</fieldset>');
and my html
<div id="Code" data-role="fieldcontain">
</div>
how to refresh this in order to style it with mobile style???
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据以下 jQuery Mobile 博客post后,您可以触发页面create事件来“一次轻松增强所有小部件”。
Per the following jQuery Mobile blog post, you can trigger the page create event to "easily enhance all widgets at once".