Partial Update data instead of update the whole tree


Hi there,

Is there any chance that DHX gantt could provide a method to just update the part of the items in the gantt tree data instead of update the whole tree inside the gantt state management?

Because update the whole tree inside the gantt state management is a really expensive operation, we wanna save that performance consume.

if there is a way to partially update the items that only changed after one operation would be a good approach.

The workflow would be like this:

  1. Gantt component has the old gantt tree data

  2. New Gantt tree data come in from server

  3. Compare (diff) the new tree and old tee, find out what changed, including:
    a. items field updated, e.g. name, dates,
    b. items deleted
    c. items added
    d. items reordered
    e. items changed a parent.

  4. only update these items, and keep other items unchanged, no need to go through the state calculation again
    would be a very efficient approach for updating the gantt data

This would reduce a lot of response time for each operation on gantt chart, especially for those who has really large and really deep leveled data.

Hope you could think about this. thanks!


Hello Kevin,
There is no such method. I will forward your suggestion to the dev team.

I think, for now, you can manually implement a solution to compare which tasks are different and obtain the diff, then parse only different tasks.
Here is an example of how it might be implemented:
As you can see, although loading a smaller number of tasks takes less time, the whole process is longer than just loading all tasks with the whole task tree.
However, it works that way with a simple configuration. Maybe in your Gantt configuration, there is some difference, but it is hard to suggest what might be wrong as I don’t see your code.
If the suggested approach doesn’t help you, please reproduce the use case the snippet, then click on the “Share” button and send me the updated snippet.