Our pure JavaScript Scheduler component


Post by sactory »

I have an issue: From Screen X, then go to => Scheduler Screen & jump to event immediately.

What is the best solution for my case?
I am looking forward to receiving the most detailed support 🙏. Thank you very much!


Post by mats »

This is the API method to call after you have opened scheduler and loaded the events:

https://bryntum.com/docs/scheduler/api/Scheduler/view/mixin/SchedulerScroll#function-scrollEventIntoView


Post by sactory »

mats wrote: Tue May 17, 2022 7:54 am

This is the API method to call after you have opened scheduler and loaded the events:

https://bryntum.com/docs/scheduler/api/Scheduler/view/mixin/SchedulerScroll#function-scrollEventIntoView

I know this function, but I don't know when the scheduler inits are done. How can I listen to the scheduler initializing and be ready for "scroll to an event"?


Post by mats »

Try listening for https://bryntum.com/docs/scheduler/api/Scheduler/model/ProjectModel#event-dataReady triggered by the Project instance

scheduler.project.on('dataReady', () => {})

Post by sactory »

mats wrote: Tue May 17, 2022 11:39 am

Try listening for https://bryntum.com/docs/scheduler/api/Scheduler/model/ProjectModel#event-dataReady triggered by the Project instance

scheduler.project.on('dataReady', () => {})

Thank you for your suggestion, but I've just tested this code with an example. The result is it prints a message after each action (drag/drop, edit, resize...), it is not run only once after initialized. I just want to scroll to an event only one time after the scheduler renders are finished (ready for scroll).


Post by alex.l »

Have a look at docs https://bryntum.com/docs/scheduler/api/Core/helper/EventHelper#function-on-static
There is once property that you can pass to achieve that:

once : Boolean
Specify as true to have the listener(s) removed upon first invocation.

All the best,
Alex


Post Reply