Hi) I have this problem, I use parents (with the split type) and children that belong to this parent, but when I open the parent, each child task is on a separate line even if they do not intersect by dates, but I need them to be on the same line if they do not intersect by dates
Hello,
Starting with Gantt 9.1.0, there is a new feature that allows you to display split subtasks on the same row even when the parent task is expanded. You can control this behavior per child with the split_placement property of a task object by using the necessary mode of splitting tasks: Split Tasks Gantt Docs.
Currently, there is no built-in feature to dynamically adjust row height and place multiple child tasks on the same visual row based on date overlap. Unfortunately, right now we don’t have a ready solution, but you can implement your custom solution. And here’s a possible implementation:
In this example, we visually “stack” multiple boxes within one row by manually shifting bars vertically using CSS classes. In this case, you’ll need to calculate offsets (or equivalent height adjustments) yourself, depending on how many assignments or boxes you want to show for each row.
Here, we apply a class depending on the calculated level:
gantt.templates.task_class = function (start, end, task) {
if (task.level) {
return "level_" + task.level;
}
};
Then we shift task bars inside a row:
.gantt_task_line.level_1 { margin-top: -30px; }
.gantt_task_line.level_2 { margin-top: -10px; }
.gantt_task_line.level_3 { margin-top: 10px; }
.gantt_task_line.level_4 { margin-top: 30px; }
Please check a full example of how it might be implemented: DHTMLX Snippet Tool.
Best regards,
Valeria Ivashkevich
DHTMLX Support Engineer
