Grid Refresh not firing in IE 9

2 posts, 0 answers
  1. Keith
    Keith avatar
    1 posts
    Member since:
    Dec 2011

    Posted 18 Dec 2012 Link to this post

    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();
        };
  2. Petur Subev
    Admin
    Petur Subev avatar
    1882 posts

    Posted 20 Dec 2012 Link to this post

    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!
Back to Top