Recently we received a requirement from out client. They wanted to be able to specify if a task’s
duration is calculated automatically (like a task of “project” type which expands automatically when you drag its children - lets call it “Mode 1”) or spcified manually (set via lightbox / dragging and resizing, like regular task - lets call it “Mode 2”). Initially, all tasks that contains a children should be in Mode 1, while all other tasks should be in Mode 2. Also, the mode changes automatically when you add first subtask (in this case mode of parent task should be set to Mode 1) or remove last subtask from the task (in such a case mode of parent task should change to Mode 2). Also, they wanted to be able to override mode in lightbox (for instance task with children can be in Mode 2 if they desired).
So, we added custom property “range” on task object and a radio button on the lightbox with two modes: “mode 1” and “mode 2”. We manupulate hidden properties:
task.$no_end. We also added handlers to
onBeforeTaskDelete to automatically change mode of parent task when last child is removed or first child is added. We had to make some workarounds to make it work properly, especially on the initial diagram load.
I was wondering if it’s possible to deliver such a feature to the Gantt diagram? Or maybe there is already a simpler way to do so?
We’re using the pro version of the library.