events overlapping

Hi.

On more thing… :slight_smile:
When I load a couple of events with load() that have similar start/end-dates the events are stacked, overlapping each other instead of beeing displayed in parallel.
The title is always visible but the body is not.
See attached screenshot.
Is there an option to have the whole event body visible all the time, never ooverlapping anything?

Thank you again.

Regards,
Gerrit


Hello,

This problem is caused by events having very small time frame. If you try to create event using drag and drop and then resize it you will notice that the minimum rendered size matches 55-60 minutes.
Though it’s possible to change logic in the source files, check the following example (sorry for the scary looks, it should be possible to do it more gracefully).

  1. Open dhtmlxscheduler_debug.js file (and include it on the page after the change).
  2. Locate scheduler._pre_render_events_line=function(evs,hold){
  3. Change while (stack.length && stack[stack.length-1].end_date<=ev.start_date) stack.splice(stack.length-1,1);
    to

if(stack.length) { var limit = 50*60*1000; while (stack.length && (((stack[stack.length-1].end_date.valueOf()-stack[stack.length-1].start_date.valueOf() >= limit || ev.end_date.valueOf()-ev.start_date.valueOf() >= limit) && stack[stack.length-1].end_date<=ev.start_date) || ((stack[stack.length-1].end_date.valueOf()-stack[stack.length-1].start_date.valueOf() <= limit || ev.end_date.valueOf()-ev.start_date.valueOf() <= limit) && ev.start_date.valueOf()-stack[stack.length-1].start_date.valueOf()>=limit ) )) { stack.splice(stack.length-1,1); } }
Hope this helps.

Best regards,
Ilya