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

Kendo Grid dataSource.read() not is working second time

1 Answer 570 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ali
Top achievements
Rank 1
Ali asked on 21 Oct 2015, 09:16 AM

Hello Everyone,

I am trying to refresh the kendo grid in javascript, when a user click on refresh button. It is working fine in Mozilla browser but in IE11 it is not working properly.

In IE11 refreshing the grid is working one time after that couldn't be able to reload the grid (calling the action method). Please find the following code..

 Controller:

 public ActionResult SelectApprovalFlow([DataSourceRequest]DataSourceRequest request)
        {
            Request objRequest = ((Request)Session["Request"]);

            return Json(GetApproverDetails(objRequest).ToDataSourceResult(request), JsonRequestBehavior.AllowGet);
        }  

Grid:

@(Html.Kendo().Grid<MyProject.Model.GetApprovals>()
        .Name("grdApprovalFlow")
        .Columns(columns =>
        {
            columns.Bound(p => p.ApprovalID).Hidden(true);
           
            columns.Bound(p => p.Approver).Width(120).Title("Approver").HeaderHtmlAttributes(new { style = "text-align:center;font-weight: bold" });
            columns.Bound(p => p.StepDescription).Width(100).Title("Step").HeaderHtmlAttributes(new { style = "text-align:center;font-weight: bold" });                      
        })  
        .AutoBind(false)


        .DataSource(
            dataSource => dataSource
            .Ajax()
                     .Events(events => events.Sync("sync_handler"))
                        .Read(read => read.Action("SelectApprovalFlow", "Approval"))
        )
    )​

 

Button:

<button id="btnApprovalFlow" onclick="return ​btnClick();">            
    My Button
 </button>​

Javascript:

 function ​btnClick() {
        $("#grdApprovalFlow").data('kendoGrid').dataSource.read();
        return false;
    }

 

Thank you so much for your help..

1 Answer, 1 is accepted

Sort by
0
Alexander Popov
Telerik team
answered on 23 Oct 2015, 08:15 AM
Hello Roohul,

The code you shared seems valid, so I am not sure what exactly causes the issue. Are there any error messages in the browser's console? Also, what is the code for the Sync event handler? Have you tried disabling the caching?

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