IE tries to download Json result when paging

5 posts, 0 answers
  1. Ben
    Ben avatar
    7 posts
    Member since:
    Nov 2012

    Posted 16 Jan 2013 Link to this post

    Hi

    I'm trialling at the moment but i'm having a problem with the grid control.

    I get the intial grid up with data to begin with but when i try to page or sort etc internet explorers asks whether I want to download the response and Firefox just displays the raw json data in a page.


    I was wondering if anyone knew where I was going wrong with this one?
    Here's the code:

    private

    IEnumerable<ReqAssess> GetRequests()

     {

     

    var reqassess = reqAssessService.GetReqAssess();

    return reqassess;

    }


    public

    ActionResult Products_Read([DataSourceRequest] DataSourceRequest request)

     

    {

     

    return Json(GetRequests().ToDataSourceResult(request), JsonRequestBehavior.AllowGet);

    }


    @(Html.Kendo().Grid(Model)

    .Name(

     

    "Grid")

    .Columns(columns =>

    {

    columns.Bound(p => p.ReqId).Width(100).Groupable(

     

    false).Title("Request ID").ClientTemplate(

    "# if (Urgent == \"Y\") { #" +

     "<div style=\"background-color: Red;\">#: ReqId #</div>" +

     "# } else { #" +

     "#: ReqId #" +

     "# } #"

     );

     columns.Bound(p => p.CompId).Title(

     

    "Company ID").Width(110);

     columns.Bound(p => p.Facid).Title("Facility ID").Width(110);

     columns.Bound(p => p.Mtrlcode).Title("Code").Width(90);

     columns.Bound(p => p.Tradename).Title("Tradename").Width(170);

     columns.Bound(p => p.Requested).Format("{0:dd/MM/yyyy:hh:mm:ss}").Width(110); ;

     columns.Bound(p => p.DateDue).Format("{0:dd/MM/yyyy}").Title("Date due").Width(100); ;

     columns.Bound(p => p.Completed).Format("{0:dd/MM/yyyy}").Title("Completed").Width(100); ;

     columns.Bound(p => p.Status).Width(150);

     columns.Bound(p => p.AssignedTo).Width(100);

     

    })

     .ClientDetailTemplateId(

     

    "employeesTemplate")

     .Groupable()

     .Pageable()

     .Sortable()

     .Scrollable()

     .Filterable()

     .Selectable()

     .Pageable(pager => pager

     .Refresh(

     

    true)

     .PageSizes(new int[4] {10, 20, 30, 40}))

     .ColumnMenu()

    .Resizable(resize => resize.Columns(true))

     .Reorderable(reorder => reorder.Columns(true))

     .DataSource(dataSource => dataSource

     .Ajax()

     .Read(read => read.Action(

     

    "Products_Read", "InTray"))

     .PageSize(30)

     ))

  2. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 17 Jan 2013 Link to this post

    Hi Ben,

     This would happen if the required JavaScript files are not included. Please check this help topic which shows what those files are. Basically you need to include jQuery, kendo.all.min.js and kendo.aspnetmvc.min.js in your layout page.

    Regards,
    Atanas Korchev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Ben
    Ben avatar
    7 posts
    Member since:
    Nov 2012

    Posted 17 Jan 2013 Link to this post

    Thanks for your help, I did have all the javascript files included but this pointed me in the right direction and I found a javascript error in my files that must have been preventing the necessary javascript for the grid from working.
  4. Patrick
    Patrick avatar
    1 posts
    Member since:
    May 2013

    Posted 06 Jun 2013 Link to this post

    Could you please post the error you found, I seem to be having the same problem.
  5. Mario
    Mario avatar
    3 posts
    Member since:
    Aug 2013

    Posted 19 Aug 2013 Link to this post

    Hi Guys,
    I am having the same problem. Any ideas?
    Best Regards,
Back to Top