Duration of gantt chart


#1

I am trying to change the duration from code on change of some custom field value but the value is not reflecting in DOM(i.e not able to see the refreshed gantt chart)


#2

Hello Sushma,
The end_date parameter has a higher priority over the duration parameter. So, when you only update the duration parameter, the end_date is not updated. You need to manually update it with the calculateEndDate method:
https://docs.dhtmlx.com/gantt/api__gantt_calculateenddate.html
Then you need to call the updateTask method to repaint the changes:
https://docs.dhtmlx.com/gantt/api__gantt_updatetask.html
Here is an example:
http://snippet.dhtmlx.com/5/26c56c954