schema: {
model: {
fields: {
Age: {
type:
"number"
}
}
}
}
if
(field ==
"Age"
)
columns[currentCol].template =
"#= (Age == null) ? ' ' : Age #"
;
Is there a way to enforce a sort order of [null/undefined, 0, 1, 2, 3...] ?
Possible Bug: Internet Explorer and Chrome sort the values differently. Being an age colum, the numbers are grouped correctly but withing the 'Age = 15 rows' the order is not the same. The orders are reversed from each other as far as I can tell with my limited testing.
8 Answers, 1 is accepted
Could you please verify that you are using latest version (Q3 2012 SP1 or Q1 2013 BETA) of KendoUI?
Greetings,Rosen
the Telerik team


IE and Chrome still end up with a different sort order in a given age group though.
I sort 460 records by Age and the age 67 group has 7 records.
In IE the records are in this order (92, 95, 96, 115, 116, 454, 525). Order is not always descending
In Chrome they are in this order (96, 92, 454, 116, 115, 95, 525).
And upgrading either the kendo controls or the jquery.min.js (which was in the kendo js folder) has caused/exposed other bugs on my site :(
I'm not sure I understood your scenario. Is there an explicit ordering set on the field which is not sorted? Could you please provide a small sample which demonstrates this behavior.
Regards,Rosen
the Telerik team

When the grid is populated the data set comes from a stored procedure that sorts on intReportID which is a hidden column in the grid. The grid doesn't know about that sort order (it is not specified in the grid set up).
The grid allows sort on a single column so the other columns sorting is not specified. I would expect the functionality to be the same in either browser and our end users will probably notice the discrepancy. If they are printing out report results they would expect the records to be in the same order no matter what browser they use.
I'm afraid that this is expected. As the records are sorted during the grouping process, their initial order may change. Therefore, to ensure that ordering is persisted you should explicitly set a sort descriptor over the appropriate field. For example:
dataSource: {
group: { field:
"Age"
},
sort: { field:
"intReportID"
, dir:
"asc"
}
}
Regards,
Rosen
the Telerik team

I am not using the group option. I am only using one single column sort. The original grid has no sort applied and then I click Age to sort 'asc.'
So without allowing for multi-column sorting, is there no way to get the same results in each browser?
Indeed, the differences in the ordering is caused by the fact that Chrome does not use a stable sort algorithm for arrays bigger then 10 elements. In your scenario in order to ensure the same ordering of the elements you should consider using server-side data processing (sorting, paging etc.). This way you will be able skip the built-in client processing and to construct the data in the desired order.
All the best,Rosen
the Telerik team