Task update duration ,ganttview not update,when i update task of duration,how to update ganttview task duraion


#1


#2

Hello @romayn,

When you change one of the task’s properties(“StartDate, EndDate, Duration)”, you should recalculate related ones, and call .updateTask(id) after that.
The code may look like the fragment below:

var task = gantt.getTask(12);
task.duration= 13;
task.end_date = gantt.calculateEndDate(task.start_date, task.duration);
gantt.updateTask(12);

Here is a demo:
http://snippet.dhtmlx.com/5/0bf42e9a2

API:
updateTask:
https://docs.dhtmlx.com/gantt/api__gantt_updatetask.html
calculateEndDate:
https://docs.dhtmlx.com/gantt/api__gantt_calculateenddate.html