Basically I need to list the stats of the teams who have most recently played a game at the top of the list.
Anyone know who to accomplish this?
2 Answers, 1 is accepted
I have already responded to you in the ticketing system but I will share my response here in case anyone else comes across this post. I am sorry to hear that you are disappointed with the lack of a custom group sort compare functionality. However, feature implementation in our roadmap and priorities depend largely on the business value and customer demand for specific components and features. We strive to implement functionalities which are in high demand first. We also have a Feature Acceleration Programme separate offering which allows a customer to negotiate a certain component or functionality to be implemented on demand or sooner than our roadmap implies.
Currently, the groups are sorted ascending by default in alphabetical order. The sort which is applied to the column headers sorts the group items, not the groups themselves.
At present, there are two options to achieve the desired custom group sort:
1) Use server operations and provide the groups as desired:
http://docs.telerik.com/kendo-ui/api/javascript/data/datasource#configuration-serverSorting
2) If you use client operations, some custom logic will be required.
- Provide another field which holds the group priority and when grouping occurs, group by that field instead-
You will need a column template to show the corresponding field value, e.g. days of the week order
- And a group header template
Here is a runnable example with the days of the week:
http://dojo.telerik.com/UgoyO
Finally, please take the time to cast a vote in the UserVoice form at:
http://kendoui-feedback.telerik.com/forums/127393-kendo-ui-feedback/suggestions/16620391-support-custom-sorting-for-datasource-groups
The most popular ideas are considered for priority implementation.
Regards,
Alex Hajigeorgieva
Progress Telerik
Tnks a lot Alex
Suggested solution works well for me
I'm using Kendo MVC 2018 R1 and it appears that I am now able to access the items from the group header template. I wasn't able to successfully do this in v2017.1. This allows me to sort by one column (object.ID or SortOrder) and display the corresponding field (object.Description), which is the same for all items in the group.
.ClientGroupHeaderTemplate(@
"#= items[0].Description #"
)
I am pleased to let you know that thanks to the popularity of this feature request we have now completed it and it will be part of the built-in options as of 2019 R1 which is planned for 16th January 2019.
Here is the public issue for your reference:
https://github.com/telerik/kendo-ui-core/issues/4024
Kind Regards,
Alex Hajigeorgieva
Progress Telerik
We have an example in the documentation section at:
https://docs.telerik.com/aspnet-mvc/api/Kendo.Mvc.UI.Fluent/GridGroupableSortSettingsBuilder
I have now added an internal task to our backlog as I do believe it is a great idea to have this in the official demos section.
However, in case you need further assistance with this functionality for the UI for ASP.NET MVC wrappers, please let me know and I can provide you with a runnable example if needed.
Regards,
Alex Hajigeorgieva
Progress Telerik
Hello, Joshua,
For the jQuery Kendo UI Grid, you can use the columns.groupable.sort.compare function and the data source group.compare function.
Regards,
Alex Hajigeorgieva
Progress Telerik
Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive, special prizes, and more, for FREE?! Register now for DevReach 2.0(20).
Hi, I have a grid that uses a datasource with group option, combining this with the example you have provided that not work.
Here is the example with group definition at the level of the datasource which breaks the group sort defined at the level of the column.
https://dojo.telerik.com/ULosEbeG/2
Could you please provide me a working example ?
Thx
My bad, you have provided two link, the second one links to how to use sort group with datasource. I will try it.
Thx
Hello,
For KendoReact we have a logged item for this functionality:
https://github.com/telerik/kendo-react/issues/633
I have added your request there as well.
I am not sure if I understood you correctly.
In case you want to group by team name and sort the groups themselves not by their name, but by date - I am afraid that this scenario is not possible. When the dataSource is grouped, the its data is sorted ascending or descending by the field it is grouped by.
If you want to group by field: team and sort the records inside the groups by date, you could use the following configuration:
var
dataSource =
new
kendo.data.DataSource({
group: { field:
"team"
},
sort: { field:
"date"
, dir:
"desc"
},
//.....
});
In this fiddle you can see the approach in action. I hope this helps.
Regards,
Alexander Valchev
the Telerik team
Thanks again for the reply, really appreciate it!
I am afraid that the implementation of such functionality is not in our immediate plans. I would recommend submitting this as a feature request in our user voice forum - a place where other users would be able to comment and vote for it. If it turns out to be popular, we will consider adding it in one of our future releases.
Regards,
Alexander Valchev
the Telerik team