Hi Support,
is There way to highlight my tasks in DHTMLX Gantt.
Thanks
Rasagb.
Hi Support,
is There way to highlight my tasks in DHTMLX Gantt.
Thanks
Rasagb.
Hello,
Yes, of course. You can change the styles of the tasks in order to pay the user’s attention. There are different ways to set a custom style for tasks. One of the options is to redefine the default tasks’ template. For this, you need to use the task_class
template. There is an article about it:
https://docs.dhtmlx.com/gantt/api__gantt_task_class_template.html
For example, to colour tasks depending on their priority, use the code as in:
<style>
.gantt_task_line.high {
background-color: red ;
}
.gantt_task_line.medium {
background-color: green;
}
.gantt_task_line.low {
background-color: blue;
}
</style>
<script>
gantt.templates.task_class = function(start, end, task){
switch (task.priority){
case "1":
return "high";
break;
case "2":
return "medium";
break;
case "3":
return "low";
break;
}
};
</script>
Also, you can specify the style in the properties of a task object or load colours with data. Please check the related docs and examples:
https://docs.dhtmlx.com/gantt/desktop__colouring_tasks.html ,
https://docs.dhtmlx.com/gantt/samples/04_customization/04_task_styles.html ,
https://docs.dhtmlx.com/gantt/samples/11_resources/01_assigning_resources.html