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

Sort failing after update

5 Answers 70 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Sam Cogan
Top achievements
Rank 1
Sam Cogan asked on 31 Aug 2013, 10:11 AM
I have a grid that has worked perfectly fine for nearly a year now, however when I updated to the latest kendo release it has started generating an error when trying to sort by any of the columns.

It's generating the following error
Invalid property or field - 'undefined' for type: worldStatsItem

Where worldStatsItem is the type of item used in the grid.

I'm using teh MVC bindings for this and the code for the grid is below.

@(Html.Kendo().Grid(Model.Results)
                         .Name("Search_Results")
                  
                         .Columns(columns =>
                             {
                                 
                                 columns.Template(m => Html.ActionLink(m.StatsItem.OutfitName, "OutfitByID","OutfitDetails", new { outfitId = m.StatsItem.OutfitId},null)).Title("Name").Width(200);
                                 columns.Bound(m => m.World).Width(100).Title("Server");
                                 columns.Bound(m => m.StatsItem.Faction).Width(100).Title("Faction");
                                 columns.Bound(m => m.StatsItem.TotalMembers).Width(100).Title("Total Members");
                                 columns.Bound(m => m.StatsItem.TotalXP).Width(100).Title("Total XP");
                                 columns.Bound(m => m.StatsItem.KdRatio).Width(100).Title("Ratio");
                                 columns.Bound(m => m.StatsItem.AverageXp).Width(100).Title("Average XP Per Member");

                                  
                                   })
                                          .Sortable(sorting => sorting.Enabled(true))
                                       
                                          
                                       
                                                         
                                          .Pageable(pageable => pageable.ButtonCount(5))
                                          .DataSource(dataSource => dataSource
                                          .Server()
                                    
                                          .PageSize(40)
                                          .Sort(sort =>
                                          sort.Add(x=>x.StatsItem.AverageXp).Descending())
                                           
                                          
 
                                                  ))

5 Answers, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 02 Sep 2013, 01:56 PM
Hi Sam,

We are aware of this issue and it has been already addressed. Please download the latest internal build and give it a try.

Regards,
Rosen
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Michael
Top achievements
Rank 1
answered on 21 Mar 2014, 02:21 AM
I just updated to the latest build, and I am still getting this error.
0
Rosen
Telerik team
answered on 21 Mar 2014, 08:29 AM
Hi Michael,

Could you please provide a small runnable sample in which the issue you are facing can be observed locally?

Regards,
Rosen
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Michael
Top achievements
Rank 1
answered on 21 Mar 2014, 01:41 PM
I was unable to paste the code into the text editor, so I attached it.  Its just snippets due to confidentiality, but we basically have a Model and a View Model, and I'm thinking it cannot figure out how to relate the two from a sort/group/filter.  Initial page load works great.

This code works, but due to inflating 11 Million items, its extremely slow:

IEnumerable<PayrollEmployeeDetailVM.Info> items = details.Select(o => InfoFactory(o));

return Json(items.ToDataSourceResult(request), JsonRequestBehavior.AllowGet);
0
Michael
Top achievements
Rank 1
answered on 21 Mar 2014, 03:46 PM
Implemented this solution and it seems to work just fine.  A bit slow on grouping, but i think its more the amount of data we have vs the viem model complexity, and not Kendo UI.

http://stackoverflow.com/questions/16484417/how-to-use-kendo-ui-grid-with-todatasourceresult-iqueryablet-viewmodel-and
Tags
Grid
Asked by
Sam Cogan
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Michael
Top achievements
Rank 1
Share this question
or