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

IE tries to download Json result when paging

4 Answers 55 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ben
Top achievements
Rank 1
Ben asked on 16 Jan 2013, 04:04 PM
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)

 ))

4 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 17 Jan 2013, 09:14 AM
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!
0
Ben
Top achievements
Rank 1
answered on 17 Jan 2013, 12:00 PM
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.
0
Patrick
Top achievements
Rank 1
answered on 06 Jun 2013, 03:41 PM
Could you please post the error you found, I seem to be having the same problem.
0
Mario
Top achievements
Rank 1
answered on 19 Aug 2013, 06:04 PM
Hi Guys,
I am having the same problem. Any ideas?
Best Regards,
Tags
Grid
Asked by
Ben
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Ben
Top achievements
Rank 1
Patrick
Top achievements
Rank 1
Mario
Top achievements
Rank 1
Share this question
or