How to update parent progress automatically?

I am using gantt chart as in the example … basic.html
I need to update the progress percentage of parent with its child values,Is possible to do like that?

When a sub task’s progress is updated,Then the progress of its parent is automatically updated based on the progress of child tasks.

there is no built-in method, but you can catch the event when a task has been modified. Then you could retrieve a chain of parent tasks and recalculate their progress … event.html … event.html … event.html

var parent = gantt.getTask(task.parent); parent.progress = some_value; gantt.updateTask(;

You can try this :

gantt.attachEvent("onAfterTaskUpdate", function(id,item){
		if (item.parent == 0) {
		var parentTask = gantt.getTask(item.parent); //console.log(;return;
		var childs = gantt.getChildren(;
		var totProgress = 0;
		var tempTask;
		for (i = 0; i < childs.length; i++) { //console.log(childs[i]);
			tempTask = gantt.getTask(childs[i]);
			totProgress += parseFloat(tempTask.progress);
		parentTask.progress = (totProgress / childs.length).toFixed(2);

this code works only

in this hierarchy

parent task 10
sub task parent 40
sub task 42

but not ( see the attachment )

parent task 10
sub task 40
sub task 42
sub task 44

please provide some kind of demo. The issue seems to be caused by something in the data you have in a chart.
You can try reproducing the error using this tool:

it works perfectly using your snippet area, thanks let me examine again why this is happening