Our state of the art Gantt chart


Post by jeanbaptiste.minani »

Hello,

I have question about calendars, when I change project calendar through

gantt.project.setCalendar(value);

Tasks end dates are recalculated even for manually scheduled events,

Screen Shot 2021-07-26 at 08.48.43.png
Screen Shot 2021-07-26 at 08.48.43.png (153.34 KiB) Viewed 303 times

This root task is representing project, I want its start date and end date to be fixed, when changing calendar its end date is recalculated, I want it to be fixed and recalculate duration only.

And I can see all changes after refresh, how to auto refresh after recalculation?


Post by saki »

...I want its start date and end date to be fixed...

I'm afraid that this is not how the scheduling engine works. The scheduling of the automatically scheduled tasks is determined by the engine depending on dependencies, scheduling mode, constraints and, of course, calendars. So when you change the calendar then the project end date changes as a result.

You may want to read:

To learn details of the scheduling process.


Post by jeanbaptiste.minani »

Thanks @saki,

How do we auto-refresh all tasks, when changing calendar?,
I see changes when I refresh the page.


Post by saki »

setCalendar triggers the propagation so no further action/refresh is required.

Notice please that it returns a Promise so the call is asynchronous. The change/update won't be immediately available after the setCalendar call. You would need something like:

gantt.setCalendar(newCalendar).then(() => {
    console.log('Calendar updated');
})

Put all your code that is dependent on the updated gantt in the Promise resolve handler above replacing the console.log.


Post Reply