events order in day/week view and maybe more ...


If there are more then one sections in the scheduler, the events for each sections are not grouped together in the day/week view.

Please have a look at the below image and follow the arrows. On Saturday, for example, the light/blue events should be placed on the same column. The same for the dark/blue ones. Each color represent a different section.

How can this be fixed? And also, please take into account that for the same section, the events might overlap.


Problem confirmed. Please try to use the updated js file instead of the original one.

If event overlap - then they will rendered as on your screenshot. But if start time of second blue event is greater or equal to the start time of the first event - it must be rendered underneath the first. (22.9 KB)

Thanks, looks much better.


Please have a look at the screenshoot. In the Admin AeroPlus section the orange lines should be on the same row and the red one on the row below of the same section.
Is it possible to fix this?


Little code customization required.
The screen as it is now is correct, because orange event has bigger starting time then red event.

there are next lines in code

scheduler._pre_render_events_line=function(evs,hold){ evs.sort(function(a,b){ if(a.start_date.valueOf()==b.start_date.valueOf()) return>; return a.start_date>b.start_date?1:-1; });

They are sort events before rendering. Now it sorted by time and id. You can change the logic and replace id with parameter which defines event color in your case. In such case events with same color will tend to occupy the same line.

I do not receive any call in those functions…

This is strange. I do receive the call if I’m testing online, but on my local development server it doesn’t work… :confused:

Was my error, the above code works only for month view, if you are using timeline , there is another line of code, in dhtmlxscheduler_timeline.js

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

try to customize it instead of the above one.