Adjust start date and have all tasks also adjust

The use case is creating projects form a template. I am looking for a way to shift a project to a new date in the future and have all of the tasks also shift forward by the same amount.

Is there an easy way to do this? Docs says

  • If both the start_date and end_date options are specified and you create a task that is outside the range, the task will disappear from the chart. Meanin that the propety chane will do nothin to the children.

But we do want the build in logic to properly move tasks with their calendars, dependencies, etc.

So is the only option then having the project have a task 0 (which is the project itself), force all child tasks to be a child of that (which adds complexity to addin child task and validation) and then when a shift needs to happen change the start date of task 0?

I dont want this to conflict with the MS project import and export which we are using.

@branjos

Hello Corbett,
Project tasks ignore the date parameters. Even if you modify them by using Gantt API and Javascript, your changes will be overwritten after the next repainting occurs. The project tasks will obtain the dates from their children.
But if you want to change the dates of all tasks and use the auto-scheduling extension, you can modify the gantt.config.project_start property and auto-schedule all tasks:
https://docs.dhtmlx.com/gantt/api__gantt_project_start_config.html
Here is an example of how it works:
http://snippet.dhtmlx.com/5/74d720254

Another way is to manually update the dates of all tasks by using the eachTask method:
https://docs.dhtmlx.com/gantt/api__gantt_eachtask.html

Here is an example:
http://snippet.dhtmlx.com/5/4c6039c01

Hello @ramil,
I was looking at this snippet http://snippet.dhtmlx.com/5/74d720254 you provided. It works for me if the date is greater than the current gantt.config.project_start but it does not respond if the new gantt.config.project_start is already passed date/lesser than of current gantt.config.project_start.

Please check the modified snippet here http://snippet.dhtmlx.com/5/437a150b3.

Thank you.

Hello,
You need to enable the strict mode, then Gantt will reschedule tasks to the earlier date:
https://docs.dhtmlx.com/gantt/desktop__auto_scheduling.html#:~:text=%3D%20true%3B-,Strict%20mode,-By%20default%2C%20tasks
Here is the updated snippet:
http://snippet.dhtmlx.com/5/728ff5ec1

Hi @ramil,

Yes, I do have enabled the strict mode, still, I am not able to schedule back dated.

Please find the code snippet below,
https://snippet.dhtmlx.com/o7iotwzr

Hello @ramil,
The snippet https://snippet.dhtmlx.com/o7iotwzr I sent previously was on version 7.0 Pro because that is what we have purchased, When I change the version to 7.1 Pro it is working.

Is it a bug in 7.0 Professional? If so how can I resolve it?
I need to report to my company on the options available to fix it.

Thank you.

Hello,
Before the 7.1.4 version, the strict mode worked only when the auto_scheduling_compatibility config is enabled:
Auto Scheduling Gantt Docs.

But the project_start config is related to the current constraint auto-scheduling logic that is used by Gantt. When the compatibility mode is enabled, Gantt uses the old logic that doesn’t use the project_start config at all. That’s why it doesn’t work in the 7.0.x versions.

Before the 7.1.4 version, Gantt didn’t reschedule tasks to an earlier date with forward scheduling after changing the project_start date. In the 7.1.4 version, the dev team added that feature. So, there is no way to enable it in the 7.0 version.

The only workaround for you would be to manually update the task dates after you change the project_start config.

Thank you @ramil for your replay. We have purchased the latest version and I will get back to you if I find any issues.