As I understand currently WBS progress is based on completedDuration / totalDuration. I want to use a different formula for the progress calculation. I want to assign weightage (manully) on each task and then use that in WBS progress calculation.
See the example attached, I want to show the WBS % complete which I am calculating in the Gantt View, not the default one
Support Forum
Hello,
This is not supported out of the box. All calculations are done in the SchedulingEngine. Please see lib/Engine/data/model/event/HasPercentDone.ts. You can try to set `autoCalculatePercentDoneForParentTasks` to false and subscribe to store update and calculate percent done manually. Or you can create your own HasPercentDone mixin, implement all calculation in it, compile it to JS, extend Task model and mix your own mixin there. Unfortunately we don't have guides yet to teach you how to customize our Scheduling Engine, but they are coming. Here is the ticket: https://app.assembla.com/spaces/bryntum/tickets/9024-create-a-guide-to-show-custom-calculation-of-percent-done-field-by-changing/details
Best,
Pavel
This is not supported out of the box. All calculations are done in the SchedulingEngine. Please see lib/Engine/data/model/event/HasPercentDone.ts. You can try to set `autoCalculatePercentDoneForParentTasks` to false and subscribe to store update and calculate percent done manually. Or you can create your own HasPercentDone mixin, implement all calculation in it, compile it to JS, extend Task model and mix your own mixin there. Unfortunately we don't have guides yet to teach you how to customize our Scheduling Engine, but they are coming. Here is the ticket: https://app.assembla.com/spaces/bryntum/tickets/9024-create-a-guide-to-show-custom-calculation-of-percent-done-field-by-changing/details
Best,
Pavel
Pavlo Miklashevych
Sr. Frontend Developer
Hello,
It's supported! You can subclass TaskModel and override calculatePercentDone function. For example, lets modify TaskEditor example (examples/taskeditor/app.js) to set percent done to 0 for parent tasks:
Best,
Pavel
It's supported! You can subclass TaskModel and override calculatePercentDone function. For example, lets modify TaskEditor example (examples/taskeditor/app.js) to set percent done to 0 for parent tasks:
import '../../lib/Gantt/column/PercentDoneColumn.js';
class MyModel extends TaskModel {
* calculatePercentDone (proposedValue) {
// call parent function to get original calculation result
let value = yield* super.calculatePercentDone(proposedValue);
console.log(this.name, proposedValue, value);
return this.isParent ? 0 : value;
}
}
const gantt = new Gantt({
....
columns : [
{ type : 'name', field : 'name', text : 'Name', width : 250 },
{ type : 'percentdone' }
],
....
});
Pavel
Pavlo Miklashevych
Sr. Frontend Developer