Find a specific task from the gantt chart without refreshing the gantt chart

Hi, I have to find specfic task using the task id, without refreshing the gantt chart but gantt.getTask method is not working for deeply nested child task. how can this be accomplished


The gantt.getTask() method doesn’t refresh the Gantt chart. If you invoke this method, Gantt won’t be re-rendered on the page.
Please check the example: ;
This method returns the task which is loaded into the Gantt, and it doesn’t depend on the tree level of the child task.
Also, you can iterate over all tasks by using the eachTask method:
eachTask Gantt Docs ;
and get the required task.
Please check the example: ;
If it doesn’t help you, please, add your configuration in the snippet above and make sure that the issue is reproduced there. Then, click on the Save button and send me the link. Or send me a ready demo with all the necessary JavaScript and CSS files so that I can reproduce the issue locally.

Hii @ArtyomBorisevich , I’ve to show the specific task using gantt.showTask(highlight). I’ve the task id of the task which I need to find/highlight. But I’m not able to traverse inside the node which means it’s not highlighting the task if $open = false when the nodes are closed. it is not opening the nodes.

Hello Genni,
If the parent tasks are collapsed, Gantt will still scroll to the horizontal position of the task.
Here is an example:

If you want to expand all parent tasks, you need to do it manually before using the showTask method.
For that, you need to use the open method inside the eachParent method. And to repaint the changes only once, it is better to put all the code inside the batchUpdate method:

Here is an example: