Hi.
I work with scheduler 4.1.2v with angular 11.
I am trying to implement when you scroll to the end/start of the scroll I want to add time span for continue the scroll.
I listen on subGrid 'scroll end' event:
scheduler.getSubGrid('normal').scrollable.on('scrollend', this.horizontalscroll.bind(this));
and this my function:
// Update the start/end view dates.
horizontalscroll(event: {
grid: Scheduler,
scrollLeft: number,
source: Scheduler,
subGrid: SubGrid,
type: string,
srcElement: HTMLElement
}) {
const scrollElement: HTMLElement = event.srcElement;
const visibleDateRange: BryntumDateRange = this.scheduler.instance.visibleDateRange as BryntumDateRange;
// If user scroll to end of the right scroll.
if (scrollElement.scrollWidth === scrollElement.scrollLeft + scrollElement.offsetWidth) {
this.scheduler.instance.setEndDate(new Date(visibleDateRange.endMS + week), false);
// If user scroll to end of left scroll.
} else if (scrollElement.scrollLeft === 0) {
this.scheduler.instance.setStartDate(new Date(visibleDateRange.startMS - week), false);
}
I set 'keepDuration' to false in both cases.
When user scroll to right I set the end date by add week, It works like expected.
The problem is when user scroll to the beginning I use setStartDate function with keepDuration=false, It works like with keepDuration=true.
Am I do something wrong?