Our state of the art Gantt chart


Post by licjapodaca »

Is there a way to set a different value to the percentDone of a parent task instead of a calculation of the percentDone from its Childs?

percentdone-parent.png
percentdone-parent.png (397.79 KiB) Viewed 396 times

As you can see in the image, we receive from the database a 100% in the percentDone from the parent task, but in the Gantt component appears us a 65% of percentDone, I think is the calculation of the percentDone from its Childs.

Can we set a different value to the percentDone of the parent task? if so, how can I do that?

Regards


Post by arcady »

You can disable that rolling up by operating this field: https://bryntum.com/docs/gantt/engine/classes/_lib_engine_quark_model_gantt_ganttprojectmixin_.ganttprojectmixin.html#autocalculatepercentdoneforparenttasks
That's a boolean field defined on the project. By default it's true and if you change its value to false tasks will stop rolling up their percentDone values:

class MyProject extends ProjectModel {
    static get fields() {
        return [
            // change the field default value to false
            { name : 'autoCalculatePercentDoneForParentTasks', defaultValue : false }
        ];
    }
}

const gantt = new Gantt({

    projectModelClass : MyProject,

    ...

Post Reply