search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

DayPilot Scheduler sometimes puts different "event containers" on the same line

Asked by David B
1 year ago.

For the most part setting an "event container" property (https://doc.daypilot.org/scheduler/event-containers/) on an event correctly places all items with the same container on the same line exclusively.

Under some circumstances, however, it becomes confused and will place items with different containers on the same line.

See attached screen shots with anonymized data. the label of the event is the container id (string).

In the first screenshot (7749) you can see that the last line contains events with different containers.

Moving (dragging) event "Container 2_1" to the Friday column results in screen shot 9672, where it is placed on a different line, but one also shared by a different container (0_0)

Dragging 2_1 to Tuesday, however, results in screenshot 8081, which I think is correct - each container is on a separate line.

Answer posted by Dan Letecky [DayPilot]
1 year ago.

The container joins the member events into a single virtual event. The virtual events are then treated in a standard way - there can be multiple events in the same line in a row, if they don't overlap. It means using a container doesn't ensure that there will be only one container per line.

Please see the following tutorial for an overview of event stacking options:
https://code.daypilot.org/91222/javascript-scheduler-event-placement-strategies

It's now also possible to split a resource into multiple rows (that may be another option):
https://doc.daypilot.org/scheduler/split-resources/

Comment posted by David B
1 year ago.

Thanks Dan, I now understand better how containers are supposed to work. The tutorial is very helpful. I did actually find the "line" property whilst digging through the code, but it didn't seemed to be documented amongst the other Event properties, so I thought it might be for internal use only. I can get the behavior I need by using my container values to calculate line numbers at the back end.

Thanks again

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.