scroll 2 daypilot component in a single scroll event
Asked by Anonymous 3 years ago.
How to handle the scroll for 2 daypilot component in a single scroll event. Both daypilot components should be in sync while scrolling any of the component. headers will be same for both.
// 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.