You can synchronize two Schedulers using a native scroll
event as demonstrated in this demo:
https://javascript.daypilot.org/demo/scheduler/eventmovingtwoschedulers.html
// scrollbar synchronization
dp.nav.scroll.addEventListener("scroll", function () {
dp2.nav.scroll.scrollLeft = dp.nav.scroll.scrollLeft;
});
dp2.nav.scroll.addEventListener("scroll", function () {
dp.nav.scroll.scrollLeft = dp2.nav.scroll.scrollLeft;
});
The dp
and dp2
variables hold DayPilot.Scheduler objects. In Angular, you need to access the objects in ngAfterViewInit or later and you need to cast them to any
because the nav
property is internal.
In some cases, it might be better to use frozen rows instead of two Schedulers:
https://doc.daypilot.org/scheduler/frozen-rows/