Start Building Professional
Web Apps Today

Categories Question details Back To List
Question  posted by Ovedos on Oct 09, 2009 05:40
open dhtmlx forum
dhtmlxScheduler - Event aligment


I'm working with dhtmlxScheduler and i have question - is it posssible to change inline order of events via API.

Currently all events are automacily aligned to left margin order by begin date.

Is posiible to place event with with for example important/high prioryty always as first (on left side), and then others (also is they started before important task).
Answer posted by Stanislav (support) on Oct 09, 2009 06:04
Can be done only by code modification. 

You can locate next code lines ( originally stored in the event.js ) 

      evs.sort(function(a,b){ return a.start_date>b.start_date?1:-1; })

The sorting order defines order in which events will be placed on view. 
You can change it as 

              if (a.priority > b.priority) return 1;
              if (a.priority < b.priority) return -1;
              return a.start_date>b.start_date?1:-1; })