Discuss anything related to web development but no technical support questions


Post by akalanka »

In the current project I'm working on, we are implementing a feature to enable/disable 24hour view, which can be used for viewing either the working hours only or entire 24hours of a day.

This requires to update the TimeAxis Ticks data, which is assigned to timeAxis.generateTicks as a function in the initial configuration.

I'm having an issue with updating TimeAxis Ticks, because of the function gets called only if I change the TimeSpan of the time Axis. It does not get called if the same StartTime and EndTime passed through setTimeSpan method.

Is there any way I can update the TimeAxis Ticks, or call the generateTicks method manually when I needed it to update ?


Post by sergey.maltsev »

Hi!

Instead of the setTimeSpan method on TimeAxis, try using setTimeSpan method on Scheduler

scheduler.setTimeSpan(new Date(2024, 10, 11), new Date(2024, 11, 11));

This will call generateTicks method and also preserve scrolling position.

If this won't help, please provide a code sample which we can inspect.


Post by akalanka »

Hi sergey,
Thanks for the quick reply.

I have tried using the scheduler.setTimeSpan method as well.
In both cases, generateTicks only gets called if I pass a new date rage into setTimeSpan() method.
If I pass existing time range, (even as a deep copied Date objects), generateTicks is not getting called


Post by sergey.maltsev »

Hi!

What is purpose on passing the same date range?
If date are the same as existing nothing should happen.

You may try to set the same https://bryntum.com/products/scheduler/docs/api/Scheduler/data/TimeAxis#property-viewPreset again and see if that helps.


Post Reply