Branch loading lagging behaviour

I have a Gantt with a good amount of tasks and subtasks so on-demand loading is a must. However, the behavior I am experiencing is not very satisfying.

I will try to explain what kind of lag I am experiencing.

When the initial tasks (top parent) are loaded and I click on a task there is a delay of ~1 sec. before onStartLoad event is called. To make it even more clear here is how the Gantt behave:

  1. I click on a task and it takes one-second to highlight the row in default yellow color and the plus icon to become minus. (Doesn’t matter if I click in the gird, the plus icon or the task layer itself.)

  2. When I click on a task that was previously clicked and its subtasks has been loaded the row highlights without delay, so this makes me think that it is related to some inner method responsible for the branch on-demand loading.

Let me know if I can make anything to get rid of this lag.

Hello Nikolai,
Do you use the smart rendering extension and static background? It helps to improve performance:
https://docs.dhtmlx.com/gantt/desktop__performance.html
If there is only smart rendering enabled, opening a parent with 255 tasks takes 3 seconds to show those tasks.
With those options enabled, I don’t see a big difference when the tasks are loaded on demand or in a regular way.

If that doesn’t help you, please give me more information on how to reproduce the issue. How many tasks do you have and how many children do you load when you open a parent? Which performance tweaks do you use?
Otherwise, you can send me a sample with all necessary Javascript and CSS files so that I can reproduce it locally.

I have onTaskClick event which calls gantt.open(taskID) and it takes between 330 - 800 milliseconds to complete.

Is there a reason why this method is so slow?
How can I select the row instantly and after that call gantt.open() function?

Hello Nikolai,
Looks like, when you use that method, it takes time to load the data. Only after that, the task is selected. You can use onTaskSelected event handler to open closed tasks:

gantt.attachEvent("onTaskSelected", function(id){
	if (!gantt.getTask(id).$open) gantt.open(id)
});

You can see how it work in the following snippet:
http://docs.dhtmlx.com/gantt/snippet/e12394a5