This is a migrated thread and some comments may be shown as answers.

Grid Refresh not firing in IE 9

1 Answer 145 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Keith
Top achievements
Rank 1
Keith asked on 19 Dec 2012, 01:01 AM
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:
@(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();
    };

1 Answer, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 20 Dec 2012, 09:06 AM
Hello Keith,

Could you try to initialize the Window only once when the page is loaded and when you want to open the window just call the following line and refresh the Grid's dataSource?

var showWindow = function() {
        $('#windowName').data("kendoWindow").center().open();
            $('#grid').data("kendoGrid").dataSource.read();
    };


Kind Regards,
Petur Subev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
Keith
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Share this question
or