0

我使用Kendo UI Grid創建了一個項目,它在Chrome和Mozilla中運行得非常好。網格可以自動刷新。但在探險家,它不能!只有第一次(頁面第一次打開時)數據源工作(腳本),然後數據源不能在刷新時間工作。Kendo UI網格不會在Internet Explorer中自動刷新

這兩情況下,電網無法刷新:

  1. 當我從「EDİTPAGE」回來,我可以在網格看到更新後的值。但在Chrome和Mozilla中,我可以看到。
  2. 我有一個名爲setInterval的自動刷新命令,網格無法在資源管理器中再次刷新。它只能在Chrome和Mozilla中刷新。

    setInterval(function() { 
         $("#grid").data("kendoGrid").dataSource.read(); 
        }, 10000); /// not work! 
    
    
    $(document).ready(function() { 
         $("#grid").kendoGrid({ 
            sortable: true, 
            pageable: { 
             input: true, 
             numeric: false, 
             buttonCount: 5, 
             pageSizes: true 
            }, 
            autoBind: true, 
            height: 500, 
            selectable: "row", 
            dataSource: { 
             pageSize: 5, 
             transport: { 
              read: "/Home/Getdata", //// here works one time in explorer. Then it's not work. I change page and come back again but not work. 
              type: "json" 
             }, schema: { 
              data: "data", 
              total: "total" 
             }, 
             serverPaging:true 
            }, 
            change: function (e) { 
             var item = this.dataItem(this.select()); 
             win.content(template(item)); 
             win.open(); 
            }, rowTemplate: kendo.template($("#rowTemplate").html()),altRowTemplate: kendo.template($("#altTemplate").html()) 
           }).data("kendoGrid"); 
    

回答

0

一些問題第一。你使用的是什麼版本的IE?您正在使用哪個KendoUI版本?您是否在開發工具中檢查了網絡選項卡,以查看加載網格時是否存在500錯誤?

你是否將setInterval()綁定到一個事件?我懷疑你需要將它附加到文檔就緒功能。請參閱this示例。

+0

我使用IE 11.我使用kendoui web 2013開源..在例子中,自動刷新是工作。但在我的項目中沒有。 –

+0

我將首先使用我發佈的鏈接中的示例。在$(document).ready()中移動setInterval函數。 – Todd

+0

我看IE網絡..當我點擊「Allways刷新服務器」我的網格可以刷新。但是當我重新點擊它時,它不起作用。它給出的結果是304 .... –