Questions on Horizontal layout of overlapping events

Our schedule often has different types of events that overlap in time as shown below.


First, why is the width of the first event so much smaller than that of the overlapping event. Is there a way to make the two event have roughly the same width.

Second, is there a way to control the order that the events are laid out horizontally. In the above image sometimes the green event is to the left of the purple event and sometimes it is to the right. I’d to be able to always layout the purple events to the left of the green events.

thanks,
Ken

You can try to use the cascade view
docs.dhtmlx.com/doku.php?id=dhtm … nt_display

is there a way to control the order that the events are laid out horizontally.
Normally if events has the same starting time - order of rendering is defined by order in which they was added ( order in data xml )

The cascade view worked for fixing the widths of the events - thanks.

However, the horizontal order of events seems to be affected by the _pre_render_events_line function which sorts just by the start date. This sort function does not seem to preserve the order of events in the data.xml that have equal start times (I don’t think the javascript spec guarantees that sort function is stable).

I was able to get around the problem by replacing the call to sort in the following code with a custom sort function.

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

It would be nice if this was a bit easier to customize. For example, by just supplying the sort function instead of having to modify the definition of _pre_render_events_line.

(I don’t think the javascript spec guarantees that sort function is stable)
Yep, js spec recommends quick sort usage, which doesn’t provide “stable-sorting”
We will look how this part can be done in more customizable way.