In dthmlx gantt Chart inside gantt_task_content how i can create custom elements


I want to create two nodes as well as the top border inside the block is it possible with the dhtmlx if it is possible how we can achieve that. sample image i have attached below


Hello Nitish,
You can add custom HTML elements in the timeline by using the addTaskLayer method:
To calculate the position of the elements, you can use the getTaskPosition method"
Here is an example of how it might be implemented:

If you want to put all of this inside the task bar, you will need to use the task_text template where you can return any HTML elements:


Hi Ramil this solution works but if i want to add elements in the sub-group not in header of the group so how can i do that

here i dont want custom element


Hello Nitish,
In that case, you need to use the leftside_text and rightside_text templates:
Here is an example:


If i want custom element in task #1 only not everywhere so for that what can be done


Hello Nitish,
If you want to add custom elements only for task #1, you can check the ID parameter at the beginning of the addTaskLayer method or side text templates:

If you want to display them only for the tasks that don’t have children, you can check that with the hasChild method: