Kendo Mobile - Can not refresh listview on ModalView Close

时间秒杀一切 提交于 2019-12-11 01:27:00

问题


I can not refresh the listview when a dialog which add's or deletes rows from this listview is closes.

I tried several things. but the following does not work

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

what am I doing wrong?


回答1:


The following code should do the trick.

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

Check documentation on refresh for further information: http://docs.telerik.com/kendo-ui/api/mobile/listview

Iam not sure why you have used datasource.read(). This function can be used only if you have dynamic data items that are loaded into a template inside the listview and you are deleting items in the source itself and reading rest of the source items after each time you close modal view.Inorder to delete row of a listview and display rest of the rows,just calling refresh function with id of the listview is enough.



来源:https://stackoverflow.com/questions/23161388/kendo-mobile-can-not-refresh-listview-on-modalview-close

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!