Order of All Day events in Agenda View

5 posts, 0 answers
  1. Kevin
    Kevin avatar
    9 posts
    Member since:
    Aug 2013

    Posted 13 Aug 2014 Link to this post

    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?
  2. Kevin
    Kevin avatar
    9 posts
    Member since:
    Aug 2013

    Posted 13 Aug 2014 in reply to Kevin Link to this post

    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. 
  3. Kendo UI is VS 2017 Ready
  4. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 18 Aug 2014 Link to this post

    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!
     
  5. jantoine
    jantoine avatar
    7 posts
    Member since:
    Jul 2012

    Posted 22 Mar Link to this post

    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.
  6. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 24 Mar Link to this post

    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!
     
Back to Top
Kendo UI is VS 2017 Ready