Grid not displaying using AJAX

3 posts, 0 answers
  1. Jason
    Jason avatar
    20 posts
    Member since:
    Aug 2016

    Posted 10 Apr Link to this post

    Pulling my hair out trying to get this to work. The JSON file is being generated, but the grid is empty 

    Here is the  

     

         

    public ActionResult Excel_Export()
             {
                 return View();
             }
     
             public ActionResult Excel_Export_Read([DataSourceRequest]DataSourceRequest request)
             {
                  return Json(Read().ToDataSourceResult(request), JsonRequestBehavior.AllowGet);
             }
     
             [HttpPost]
             public ActionResult Excel_Export_Save(string contentType, string base64, string fileName)
             {
                 var fileContents = Convert.FromBase64String(base64);
     
                 return File(fileContents, contentType, fileName);
             }
  2. Jason
    Jason avatar
    20 posts
    Member since:
    Aug 2016

    Posted 10 Apr in reply to Jason Link to this post

    the post got away from me before I finished...  

    Here is the Razor

    @model IEnumerable<GISPortal.Models.ADGisUsers>
    @using GISPortal.Controllers
     
    <script src="//cdnjs.cloudflare.com/ajax/libs/jszip/2.4.0/jszip.min.js"></script>
     
     
    @(Html.Kendo().Grid<GISPortal.Models.ADGisUsers>()
        .Name("grid")
        .DataSource(dataSource => dataSource
        .Ajax()       
        .Read(read => read.Action("Excel_Export_Read", "ESRILIC"))
         
        )
            .Columns(columns =>
            {
                columns.Bound(p => p.Username);
                columns.Bound(p => p.DisplayName);
                columns.Bound(p => p.Department);
                columns.Bound(p => p.Office);
                columns.Bound(p => p.JobTitle);
                columns.Bound(p => p.MobilePhoneNumber);
                columns.Bound(p => p.EmailAddress);
     
                columns.Bound(p => p.EmployeeID);
                columns.Bound(p => p.GUID);
                columns.Bound(p => p.Name);
                columns.Bound(p => p.FirstName);
                columns.Bound(p => p.Initials);
                columns.Bound(p => p.LastName);
                columns.Bound(p => p.Description);
            })
        .Pageable() // Enable paging
        .Sortable() // Enable sorting
    )

     

     

    Thanks

  3. Jason
    Jason avatar
    20 posts
    Member since:
    Aug 2016

    Posted 10 Apr in reply to Jason Link to this post

    My issue was related to this post..  http://www.telerik.com/forums/kendo-synchready-is-not-a-function-error   fixed
Back to Top