When I use gantt.updateTask to update the start_date, the dependent tasks are not updated. In my snippet link, you can see that I’m calling gantt.updateTask for Task #1.
This is unlike when I use drag-and-drop. If I drag Task 1 to to another day in the future, the other tasks are automatically updated according to the link type.
Can you please let me know how to fix this issue? I want to be able to call gantt.updateTask and have the other tasks and links update accordingly.
The end_date property has a higher priority over the duration parameter. So, if you only update the duration parameter, it won’t change anything. If you update it with the start_date parameter, you will resize the task. So, yes, you need to manually update the end_date parameter by using the calculateEndDate method. If a task has a custom calendar, you also need to specify the task object as the third parameter:
Also, it is not necessary to update a task by using the state approach (when you specify the task object as a second argument). You can update the task properties, then only specify the task’s ID in the updateTask method: