if i change the duration of a child from a project in the gui the Project is also changing.
But there is no project change triggered for the database update.
Only the task child is updated in the database.
If i allow for example to drag projects “drag_project = true” and change the project by drag then it is updated in the database.
So how can i trigger a database update from the project if a child duration is changed?
Tasks with the “project” type ignore parameters such as start_date, end_date, and duration. Instead, they take data not from the database, but from their child tasks.
If you need to save the dates of “Project” tasks in the database, you can apply the methods like in this snippet:
Alternatively, you can check if the task has the parent and update it using onBeforeTaskUpdate event:
if (task.parent) gantt.updateTask(task.parent);
Here is the sample, where you can see how it can be implemented:
Ok, thanks. Taht helped me.
By the way, if you use AutoSchedule you should use onAfterAutoSchedule otherwise on onBeforeTaskUpdate all task trigger updateTask.