Our flexible Kanban board for managing tasks with drag drop


Post by kiyoshi »

I added logic where if I move the parent task to the last column (completed) the children should also go to completed and the parent's subtasks will be disabled until the parent task leaves that completed column. It is partially working as in the video, if I have a subtask in the subtask, it is not being reactive on the TaskBoard, but on the Gantt you can see that it is correctly disabled and the status column on the Gantt also appears as completed. I don't know if it is a bug...

 processItems({ taskRecord }: any) {
        if (!taskRecord.children) return;
        if (taskRecord.step === lastKanbanStep) {
          taskRecord.children.forEach((child: any) => {
            child.readOnly = true;
            child.step = lastKanbanStep;
          });
        } else {
          taskRecord.children.forEach((child: any) => {
            child.readOnly = false;
          });
        }
      },
Attachments
ParentTask.webm
(899.92 KiB) Downloaded 46 times

Post by johan.isaksson »

Hi,

taskRecord.children.forEach() will only iterate over direct children. If you want to go deeper, use taskRecord.traverse() (https://bryntum.com/products/taskboard/docs/api/TaskBoard/model/TaskModel#function-traverse).

Hope that helps!

Best regards,
Johan Isaksson

Post Reply