By default it is not possible to edit the end date on parent tasks, but only on final tasks, whereas it is possible to edit the start date of any task.
End date.PNG (58.49 KiB) Viewed 735 times
We would like to be able to edit the end date of any task too but we could not find a way so far.
The 'beforeCellEditStart' and 'startCellEdit' events are not even triggered when clicking on a parent task end date column.
Is there any config somewhere we can modify (EndDateColumn, EndDateField, Gantt feature, ...) ?
If not, could you provide some code to help us achieve this ?
Parent tasks roll up start/end dates of their children. That's why they are not editable (except if they are manually scheduled ..then they are editable since in this case user should provide start/end dates).
We are well aware of all these rules concerning the scheduling engine and roll up for parent tasks, but we need to be able to modify parent tasks end date.
A the moment IT IS POSSIBLE to modify the parent task START date, which will modify the children if the changed date is compatible with all the constraints.
How can we achieve same behaviour for the end date ?
export default class Task extends TaskModel {
// Override to make task endDate field editable
isEditable(fieldName) {
return fieldName === 'endDate' || super.isEditable(...arguments);
}
Next you need to override setEndDate method . The method has 2nd parameter keepDuration which is false by default which means that endDate changing means task "resize" instead of task "move".
And as far as I understand you want to move the task in this case:
setEndDate(date, keepDuration) {
// set keepDuration to true by default
if (keepDuration === undefined) keepDuration = true;
return super.setEndDate(date, keepDuration);
}
Thank you for your answer but the method "isEditable" does not exist in the Bryntum version we use at the moment (4.0.0) and we cannot upgrade for now.