Hi Team,
I have a dataset of tasks that are set to readonly inside of my work breakdown structure. When I add a new task inside of a readonly task it updates the duration for the parent task, but when I remove it, the duration remains:
Before:
After:
Snippet for the add task button:
static get configurable() {
return {
cls : 'bottom-toolbar-wrapper',
items : [
{
ref : 'addTaskButton',
icon : 'b-fa b-fa-plus',
cls : 'add-task-btn btn-edge',
type : 'button',
text : 'Add Task / Milestone',
onAction : 'up.onAddTaskClick'
}
]
};
}
async onAddTaskClick() {
// Find today's date and stuff it into the new task startDate
const today = new Date();
const dd = String(today.getDate()).padStart(2, '0');
const mm = String(today.getMonth() + 1).padStart(2, '0'); //January is 0!
const yyyy = today.getFullYear();
const startDate = `${yyyy}-${mm}-${dd}`
const
{ gantt } = this,
added = gantt.taskStore.rootNode.appendChild({ name : 'New task', duration : 1, startDate });
// run propagation to calculate new task fields
await gantt.project.propagateAsync();
// scroll to the added task
await gantt.scrollRowIntoView(added);
gantt.features.cellEdit.startEditing({
record : added,
field : 'name'
});
Toast.show('New Task Created');
}