Our pure JavaScript Scheduler component


Post by tomerPlanit »

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?


Post by mats »

We would recommend you to wait for 4.2.0 which supports this mode out of the box. Update coming soon!


Post by tomerPlanit »

Thanks mats.


Post by tomerPlanit »

Hi mats,
I have seen that the feature you explain is published on v4.1.3.

I checked the feature that you explain, it works fine when the scheduler initialized on first time, but when you make some zoom action you will lose this feature(not all events is inside the scroll span).

Is the new feature is care about enter all the resource time ranges to the scroll span?


Post by mats »

I have seen that the feature you explain is published on v4.1.3.

Sorry, not following.

Infinite scroll feature will be part of 4.2.0 release. https://github.com/bryntum/support/issues/1114


Post Reply