【问题标题】:Kendo Mobile - Can not refresh listview on ModalView CloseKendo Mobile - 无法在 ModalView 上刷新列表视图关闭
【发布时间】:2014-06-03 09:24:47
【问题描述】:

当从该列表视图中添加或删除行的对话框关闭时,我无法刷新列表视图。

我尝试了几件事。但以下不起作用

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();
}

我做错了什么?

【问题讨论】:

    标签: listview kendo-ui refresh kendo-mobile


    【解决方案1】:

    下面的代码应该可以解决问题。

     $("#applist").data("kendoMobileListView").refresh()
    

    查看有关刷新的文档以获取更多信息:http://docs.telerik.com/kendo-ui/api/mobile/listview

    我不确定你为什么使用 datasource.read()。仅当您将动态数据项加载到列表视图内的模板中并且您正在删除源本身中的项并在每次关闭模式视图后读取其余源项时才能使用此功能。为了删除行一个列表视图并显示其余行,只需调用具有列表视图ID的刷新函数就足够了。

    【讨论】:

    • 嗨@ShinyJos,其实我也试过这个。。列表视图不刷新
    • 很难说..你能用小提琴发布代码吗..我会试着让它工作
    • jsfiddle.net/6fWr3/4 我可能在小提琴中也犯了错误,无法在那里打开对话框
    • 我无法编辑你的代码,因为我不知道它应该做什么。请发布一个工作代码,我只能刷新你的列表
    • 我的问题变成了下面的问题stackoverflow.com/questions/23279095/…你能看看吗?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-08-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-03-30
    • 1970-01-01
    相关资源
    最近更新 更多