I have a grid set up inside a Kendo Window. If I click on a link, I open the window, and call grid.datasource.refresh from javascript. The first time I do this, it works perfectly. Once I close the window, if I try to reopen it and reload the grid with other data, the grid never refreshes. The weird part is that this only happens with IE 9. Using the latest versions of IE, Chrome and Firefox all work. Any ideas?
Grid MVC Code:
JS:
Grid MVC Code:
@(Html.Kendo().Grid<Person>() .Name("grid") .Columns(columns => { columns.Bound(x => x.FirstName).Title("First Name"); columns.Bound(x => x.LastName).Title("Last Name"); columns.Bound(x => x.EmailAddress).Title("Email Address"); columns.Bound(x => x.PhoneNumber).Title("Phone Number"); }) .DataSource(dataSource => dataSource .Ajax() .Read(read => read.Action("LoadGrid", "Dashboard") .Data("my.view.parms") // the name of the JavaScript function which will return the additional data ) ) )
JS:
var show = function () { reloadGrid("#grid"); showWindow("#window", "Lead Report"); };
var reloadGrid = function(gridElement) { var grid = $(gridElement).data("kendoGrid"); grid.dataSource.read(); };
var showWindow = function(element, title, width, actions) { var window = $(element); window.show(); if (!window.data("kendoWindow")) { window.kendoWindow({ width: width || "1400px", title: title, actions: actions || ["Close"], modal: true }); } $(element).data("kendoWindow").center().open(); };