I am currently using GPL version of Gantt.
Each task in my case displayed on the same line (render: split).
If a planning task belongs to me which starts 05.06.2019 duraton 5 days but the I am on vacation between 05.06.2019 and 10.06.2019.
There is a “collision” in this case I should have to display with different color in this case.
So, how can I display vacation dates on gantt to be able to handle collisions?
What would be the best solution?
Thanks for your reply. Addtasklayer looks promising to me.
This solution is not working if I use projects (render:“partial”) only without any parent project.
I am trying to solve my problem using an additional json which stores the vacation data.
Lets say I have different type of tasks (meeting, planning, production, etc.). Their parent project render property is set to split.
I would like to show collisions for tasks (type:planning) but addtasklayer fires only projects.
Hello Cookiez,
Gantt uses the additional layer to display split tasks that’s why it doesn’t fire for the children of the split project task.
But you can use a variable to check if we should highlight the cells or not.
The first condition check remains the same:
var highlight_vacations = false;
if (vacations.data[i].designer === task.designer) highlight_vacations = true;
Then you check if the task is split and that it has children. When it is true, you check each child task for the same condition:
if (task.render == "split" && gantt.hasChild(task.id)) gantt.eachTask(function(child){
if (vacations.data[i].designer === child.designer) highlight_vacations = true;
},task.id);
However, have you checked the work time option? The additional layer allows you to highlight the vacation days and display it over tasks. But tasks remain at the same place. While the working time stretches the tasks excluding the weekends and vacation days from the duration.
Here is an example(try moving tasks to the highlighted days): https://snippet.dhtmlx.com/795a84e74
I solved my “issue” with the following. Additional task property is added to every task named subtype.
gantt.addTaskLayer(function draw_vacation(task) {
if (task.render !== “split”)
return false;
var plantask = gantt.getTaskBy(tasks => tasks.subtype=== "plan" && tasks.parent === task.id);
if (plantask.length === 1)
{
//find if designer is on vacation and add the necessary layer
}
I tried Working time but did not find it usefull to me.
I have a small problem with column width on timeline. I would like to change the width of columns to as low as needed but it did not work.
gantt.config.subscales = [
{ unit: “day”, step: 1, date: “%d.” }
];
gantt.config.min_column_width = 10;
The lowest column width was 49px on every element but it is much more then I want.
07.
Is there any solution to be able to change column width?
Hello Zoltan,
The min_column_width parameter changes the minimal width of the column in the timeline. It doesn’t change the column width of the “lowest” scale cell. So, when you get 49px for the column width, it works as expected because 49 is not less than 10, so Gantt doesn’t change the column width.
Gantt doesn’t have a property like gantt.config.min_column_min_width.
Instead, Gantt stretches the columns to fit all the available space.
So, if you want to change the width of the minimal scale, you need to increase the displayed date range: http://snippet.dhtmlx.com/e6711b746
Get a guaranteed answer from DHTMLX technical support team
under the most suitable support plan