Thank you for your reply, especially the calculateenddate, was missing that and having tasks falling on weekends!
I ended up calling gantt.refreshData() after updating all tasks, instead of gantt.updateTask(curTask.id) and it’s working fine now. Is there a problem with this alternative can you can think of?
Only one thing missing: is there a way to programmatically advance the timeline to show a specific task? Because when I click the button the timeline goes back to the parent, so I wanted to automatically advance the timeline to the updated tasks, show the first children for example.
I ended up calling gantt.refreshData() after updating all tasks, instead of gantt.updateTask(curTask.id) and it’s working fine now. Is there a problem with this alternative can you can think of?
It will improve the performance. But if you use the Data Processor to send the changes to the backend, the changes won’t be saved after pushing child tasks.
Only one thing missing: is there a way to programmatically advance the timeline to show a specific task? Because when I click the button the timeline goes back to the parent, so I wanted to automatically advance the timeline to the updated tasks, show the first children for example.
To advance the timeline, you need to have 2 things:
Use gantt.render() instead of gantt.refreshData().
If you didn’t specify the date range, it is enough to use gantt.render() function.
If you specified the date range, you need to update it. For example:
if (+curTask.end_date < +date_range.max_date) date_range.max_date = curTask.end_date;
Use gantt.showTask(id) function to scroll to the task.