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

Grid not displaying using AJAX

2 Answers 23 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jason
Top achievements
Rank 1
Jason asked on 10 Apr 2017, 12:13 PM

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 Answers, 1 is accepted

Sort by
0
Jason
Top achievements
Rank 1
answered on 10 Apr 2017, 12:16 PM

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

0
Jason
Top achievements
Rank 1
answered on 10 Apr 2017, 04:00 PM
My issue was related to this post..  http://www.telerik.com/forums/kendo-synchready-is-not-a-function-error   fixed
Tags
Grid
Asked by
Jason
Top achievements
Rank 1
Answers by
Jason
Top achievements
Rank 1
Share this question
or