Timeline is sorted by label instead of events

In scheduler.NET MVC 5 we are trying to sort the events by start_date, but it doesn’t work. The default sorting seems to be on the label of the timeline object. We tried to update the timeline with a new sort but nothing happened.

scheduler.createTimelineView({
            name: "myTimeline",
            x_unit: "hour",
            x_step: 1,
            x_size: 24,
            x_date: "%H",
            x_start: 0,
            y_unit: scheduler.serverList("myTimeline", data),
            y_property: "vehicle_id",
            event_dy: "full",
            dy: 7,
            render: "bar",
            sort: function (a, b) {
                return +a.start_date > +b.start_date ? 1 : -1;
            }
        });

Is there a way to set the sorting mode when you configure the timeline in the controller?

Hi,
events are sorted by a start date by default. However, this does not includes the sections(rows) of the timeline, the sections are displayed in the order they are defined in and events are sorted by time inside the related section.

If you want to display section which contains an earliest event on top of scheduler, you need to sort array of sections each time user changes the displayed date

Okay, then we have to sort before we add the timeline, that worked.