当向 ListView 添加或删除行的对话框关闭时,我无法刷新 ListView 。
我尝试了几件事。但以下不起作用
function closeModalViewRemove() {
$("#modalview-app-remove").kendoMobileModalView("close");
//--- this is not working -- start ---
refreshAppList();
//--- this is not working -- finish ---
};
function refreshAppList() {
var applist = $('#applist').data('kendoMobileListView');
applist.dataSource.read();
applist.refresh();
}
我做错了什么?
最佳答案
下面的代码应该可以解决问题。
$("#applist").data("kendoMobileListView").refresh()
查看有关刷新的文档以获取更多信息:http://docs.telerik.com/kendo-ui/api/mobile/listview
我不确定你为什么使用 datasource.read()。仅当您将动态数据项加载到 ListView 内的模板中,并且您要删除源本身中的项目并在每次关闭模态视图后读取源项目的其余部分时,才可以使用此函数。一个 ListView 并显示其余行,只需使用 ListView 的 id 调用刷新函数就足够了。
关于listview - Kendo Mobile - 无法刷新 ModalView 上的 ListView ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23161388/