I’m using the get task position in a getEachTask, but the width is returning 0. The children are rendered as split tasks, so I’m wondering if that’s the issue? If I try and create a layer directly from the split tasks they never seem to find the tasks.
https://docs.dhtmlx.com/gantt/api__gantt_gettaskposition.html
const main_el = document.createElement(‘div’);
gantt.eachTask(function (child: any) {
if (child.entityname === “child_related” && child.related_start_date !== “” && child.related_end_date !== “”) {
var sizes = gantt.getTaskPosition(child,child.related_start_date,child.related_end_date);
var el = document.createElement(‘div’);
el.className = ‘adjustmentRelatedDates’;
el.setAttribute(“data-value”, child.id);
el.style.left = sizes.left + ‘px’;
el.style.width = sizes.width + 10 + ‘px’;
el.style.top = ‘32px’;
main_el.appendChild(el)
}
}, task.id)
return main_el