Javascript 剑道UI网格在Internet Explorer中不会自动刷新
我使用KendoUIGrid创建了一个项目,它在Chrome和mozilla中运行得非常好。网格可以自动刷新。但在explorer中,它不能!只有第一次(当页面第一次打开时)数据源工作(脚本),然后数据源在刷新时不工作 这两种情况下,网格无法刷新:Javascript 剑道UI网格在Internet Explorer中不会自动刷新,javascript,jquery,internet-explorer,google-chrome,kendo-grid,Javascript,Jquery,Internet Explorer,Google Chrome,Kendo Grid,我使用KendoUIGrid创建了一个项目,它在Chrome和mozilla中运行得非常好。网格可以自动刷新。但在explorer中,它不能!只有第一次(当页面第一次打开时)数据源工作(脚本),然后数据源在刷新时不工作 这两种情况下,网格无法刷新: 当我从“EDİTPAGE”返回时,我可以在网格中看到更新的值。但在chrome和mozilla中,我可以看到 我有名为setInterval的自动刷新命令,网格无法在资源管理器中再次刷新。它只能在Chrome和Mozilla中刷新 setIn
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");
首先是一些问题。你正在使用什么版本的IE?您使用的是哪个版本的KendoUI for Web?您是否检查过dev tools中的network选项卡,查看加载网格时是否有500个错误
是否将setInterval()绑定到事件?我怀疑您需要将其附加到document ready函数中。参见示例。我使用IE 11。我使用kendoui web 2013开源。。在示例中,自动刷新是可行的。但在我的项目中不是。我会从我发布的链接中的例子开始。将setInterval函数移到$(document).ready()中。我查看IE网络。。当我单击“Allways refresh servers”时,我的网格可以刷新。但当我重新点击它时,它就不起作用了。它给出的结果是304…我在“网络”区域看到。我的代码“getdata”是工作。。。它发送请求。。结果是取304和414 B。。。但网格不会改变。304不是问题所在。414错误表示请求uri太长。