Setting type on task to ‘project’ will make the gantt ignore the actual duration and render it as 1 alwayse, is this expected? I have tried the example Loading subtasks on demand (branch loading), set the task type to project and then it breaks
Hello,
This behavior is expected because project tasks depend on the dates of their child tasks. If the child tasks are not loaded, the project dates cannot adjust dynamically.
To address this, you can dynamically adjust the task type during loading. For example, if a “project” type is detected, temporarily switch it to “task,” store the original type in a custom property, and assign the required dates. Upon expanding, restore the original type, and this will update the dates based on the child tasks.
Alternatively, preloading all tasks without displaying them ensures accurate date calculations while maintaining performance.