问题
I was trying to refresh my kendo grid after doing an update of the data by using the following piece of code in the success handler of my ajax call:
$("#grid").data("kendoGrid").dataSource.read();
$("#grid").data("kendoGrid").refresh();
Well this refreshes and works perfectly as expected in Mozilla and Chrome but in IE the refresh does not seem to work nor does the datasource update. Do I need to make any particular modifications in my code to get it working in Internet Explorer as well?
PS: I even happened to try out $("#grid").data("kendoGrid").dataSource.sync(); which too was not working.
回答1:
Thanks for the answer knikolov. Well the issue was that the result was being cached as you said(I was using IE10 infact). Was able to resolve the issue by specifying "cache: false" in the transport element of the datasource.
transport: {
read: {
url: "xyz.svc/ab",
cache: false
}
}
回答2:
I guess you are using old IE browser, and the issue that you face is due to caching. This thread shows how to deal with caching in IE:
Prevent caching of pages in Internet Explorer 8
来源:https://stackoverflow.com/questions/29466255/kendo-grid-datasource-refresh-does-not-work-in-ie