The issue is that every time I expand any parenting task, the whole Gantt is rendered again and classes are added wrongly as you can see attached image.
Hello Pavel,
You need to check the task index within the branch by using the getTaskIndex method: https://docs.dhtmlx.com/gantt/api__gantt_gettaskindex.html
Also, don’t forget to add the odd class name in the style rules, otherwise some rows won’t be highlighted.
Regarding child tasks, you check the index within the branch of their parent task.
Here is an example of how it might be implemented: http://snippet.dhtmlx.com/ad2629ab9
It works but I have one additional question. Do you know how to apply this logic to the right “calendar” fields as well?
Currently, I am using this but it is not working properly: