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

Order of All Day events in Agenda View

4 Answers 170 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Kevin
Top achievements
Rank 1
Kevin asked on 13 Aug 2014, 11:34 PM
I am using a scheduler with an Agenda View and all day events ONLY. There are no events that have times. My goal is to control the order by which the all day events appear.

I designate an event by a resource which can be one of two types:
1 - red
2 - blue

In the agenda view I want to order the All Day events by date (default) and then by my resource types (list all of type 1, then list all of type 2). The data is pre-sorted before going to the control by Date, then by Type, but it appears as though the scheduler randomly adds the All Day events by day and not in the order they arrived.

What can I do to achieve my goal?

4 Answers, 1 is accepted

Sort by
0
Kevin
Top achievements
Rank 1
answered on 14 Aug 2014, 12:43 AM
I figured out a "workaround", but i'd like to know the proper way to do it.

I have a ROWID for each record so I did: Start time = Start time + ROWID

So basically i'm adding 1 minute to the start time of record 1, 2 minutes to the start time of record 2, and so on. 

This ordered all of the records in the agenda view correctly. If all of the start dates are the exact same it ignores the order that appears in the JSON. 
0
Atanas Korchev
Telerik team
answered on 18 Aug 2014, 06:08 AM
Hello Kevin,

Indeed the agenda view sorts the events by start time and then by end time before rendering them. In some browsers sorting isn't stable though which means that events with same start time can end up in different position than their original. The clever workaround you have found is currently the only option to keep the events in the required order.

Regards,
Atanas Korchev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
jantoine
Top achievements
Rank 1
answered on 22 Mar 2016, 12:41 PM

I think Telerik should address this inconsistent sort order problem. It can be fixed by adding an additional sort clause in the scheduler views to sort by the unique id after the date order.

events = new kendo.data.Query(events).sort([
    {
        field: 'start',
        dir: 'asc'
    },
    {
        field: 'end',
        dir: 'desc'
    },
    {
        field: 'uid',
        dir: 'asc'
    }

Thanks.
0
Georgi Krustev
Telerik team
answered on 24 Mar 2016, 09:05 AM
Hello jantoine,

Thank you for the suggestion.

Indeed, the Agenda view sorting behavior can be improved. This is logged in our product backlog and we will address it in some of our future releases. Whether it will be implemented depends on the priority of the other tasks that we have for the current Q.

Regards,
Georgi Krustev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Scheduler
Asked by
Kevin
Top achievements
Rank 1
Answers by
Kevin
Top achievements
Rank 1
Atanas Korchev
Telerik team
jantoine
Top achievements
Rank 1
Georgi Krustev
Telerik team
Share this question
or