Our pure JavaScript Scheduler component


Post by rifhan »

Hi,

version - schedulerpro 4.3.0

I need to be able to fix a timespan for all the view presets( i have setup 5 custom view presets), such that the user can only work with the scheduler starting from 3 months prior to the current date. This needs to work despite enabling zooming in the scheduler.

I tried the following two options,

  1. listening to the presetChange event and setting the timespan using setTimeSpan for the scheduler.
  2. listening to the presetChange event and setting the startDate using setStartDate for the scheduler.
  3. setting the startDate in the viewPreset config itself.

the first two options work but the issue is in zooming. so when i zoom out (weekly view to a monthly view) the focus of the UI moves to different date in the timeline.

eg- if i zoom out from Nov 14, 2021 the UI's focus is in some random month in 2023. so i need to scroll back to Nov 2021.


Post by alex.l »

Hi rifhan,

Try to use https://bryntum.com/docs/scheduler/api/Scheduler/view/mixin/TimelineScroll#function-scrollToDate
It has an option block to keep the selected date in desired position. (start/end/center/nearest).

All the best,
Alex


Post by saki »

There is also https://bryntum.com/docs/scheduler/api/Scheduler/view/TimelineBase#function-preserveViewCenter method that can be called on scheduler which executes the passed function but keeping the view center intact.

You can try to wrap setTimeSpan in this function – it should help.


Post Reply