Hi,
I am facing a problem with the template changes “task_cell_class” because as mention in the doc we can normally get the task item associated to the row where the cell is but the type of the object item is “Date” and because of that I can not directly get the task object of the row where the cell is.
(Refer to this doc: docs.dhtmlx.com/gantt/api__gant … plate.html)
For the moment, the only way I found to get the task item is to iterate on all tasks objects of the gantt and synchronise the global index of the task with the number of row where the cell is with a counter.
I am now doing that :
var number_of_displayed_tasks = gantt.getVisibleTaskCount();
tasks.forEach(element => {
var t = <Task> element;
let number_of_column = 16;
if(t.is15)
number_of_column = 16;
else
number_of_column = 31;
console.log(Math.trunc(t.compteur/number_of_column));
if(Math.trunc(t.compteur/number_of_column) == gantt.getGlobalTaskIndex(t.id))
{
if(t.parent)
isParent = false;
else
isParent = true;
}
t.compteur++;
//console.log(gantt.getVisibleTaskCount());
// Initialisation des compteurs si atteint la fin
if(t.compteur == number_of_displayed_tasks*number_of_column)
{
t.compteur = 0;
}
But as you can see it is very costly to iterate on each task of the gantt on each cell…because of that there are some lag when I load a big amount of tasks. So I am asking myself if it is possible to get an update of dhtmlx gantt where we can directly get the task item of the row of the cell when we try to change the template of a cell of the timeline.
Thanks in advance.