更新后正在刷新Jquerymobile中的Gridview
Refreshing Gridview in Jquerymobile after update
我使用"jquery mobile"插件创建了一个页面,其中的网格块由按钮组成。网格中的按钮是在运行时动态创建的。回拨后,旧的价值观仍然存在。我想在更新后用新值刷新网格。
这是代码。
Html:
<div id="chapter_div" data-role="page" data-content-theme="a">
<div data-role="header">
<h1>Chapter Chooser</h1>
</div>
<div data-role="content" class="ui-grid-d" id="show_chapter_number">
</div>
</div>
Javascript/Jquery代码:
function showChapter(book_id) {
var chapter_count=" ";
var menu = " ";
var html = " ";
var row_count = 1;
var row_block_id = 'a';
chapter_count = getChapterCount(book_id);
for (itr = 1; itr <= chapter_count; itr++) {
switch(row_count) {
case 1:
row_block_id = 'a';
row_count++;
break;
case 2:
row_block_id = 'b';
row_count++;
break;
case 3:
row_block_id = 'c';
row_count++;
break;
case 4:
row_block_id = 'd';
row_count++;
break;
case 5:
row_block_id = 'e';
row_count=1;
break;
}
html += "<div class='"ui-block-"+row_block_id+"'"><button onclick='"javascript:showVerse(" + book_id + ",''" + itr + "'');'" class='"ui-bar ui-bar-c'" style='"width:70px'">" + itr + "</button></div>";
}
var grid_chapter = $('#show_chapter_number');
grid_chapter.append(html);
$.mobile.changePage("#chapter_div", {transition: 'pop', role: 'dialog'});
**grid_chapter.content("refresh");**
}
回发后,我应该如何刷新网格或内容中的项目?
我应该如何更改这行代码:grid_chapter.content("refresh");
以使其正常工作?
谢谢。
尝试trigger("create")
方法:
grid_chapter.append(html).trigger("create");
相关文章:
- 如何取消选择所选选项并将JqueryMobile中选择的值刷新为1st
- 在jquerymobile中设置按钮css属性的动画
- 如何更改jquerymobile中默认的加载ajax加载程序gif
- 如何限制用户只能在日期选择器jquerymobile中选择两天前的日期和当前日期
- 如何正确使用jquerymobile和phonegap中的快速按钮
- 页面更改无法在android上使用Phonegap Build的JqueryMobile中工作
- phonegap和jQueryMobile中的表单验证不起作用
- 如何将此应用于jquerymobile中的所有页面
- jQueryMobile中的程序化(相对于基于链接的)导航
- 点击jquerymobile中的输入字段时弹出触发器
- 使用jQueryMobile中的表单提交处理程序进行验证,但阻止发送
- 在pagebeforehow需要使用jquerymobile中的名称和值来选中复选框
- 如何将图像放入jquerymobile中的按钮中
- jQueryMobile中的动态链接
- jquerymobile中的按钮无法按预期工作
- jquerymobile中的列表刷新
- 点击jquerymobile中的事件
- jQueryMobile中的Flipswitch给出初始化错误
- JQueryMobile中的弹出/工具提示位置
- 更新后正在刷新Jquerymobile中的Gridview