Resource Grid issue when unfolding node

I initially created a resource datastore and then filled it with some resources. The display works and calculates everything correctly.
grafik

Then I have reset the gantt with clearAll() and removed all tasks. This also removed all resources from the resource datastore.

Now I loaded new tasks, which automatically bring new resources with them, which I saved in the resource datastore. The display works fine at first:
grafik

But when I try to unfold department 3, I get the following error:
grafik

Version: 6.2.0

Hello Yannick,
Unfortunately, I couldn’t reproduce the issue:
https://snippet.dhtmlx.com/5/9cdaf0af1
And it is hard to suggest what might be wrong as I don’t see your code. Please, reproduce the issue in the snippet, then click on the “Share” button and send me the link. Or send me an HTML file with all the necessary Javascript and CSS files.

Hello ramil,
I was able to reproduce the error in your snippet, here is the link:
https://snippet.dhtmlx.com/5/c8e828193

It is important that you load different resources and not the same resources every time!
Try the following steps:

  1. Open/Close/Click some resources in resource grid
  2. Clear data
  3. Load resources
  4. Open/Close/Click some resources in resource grid
  5. Clear data
  6. Load resources
    And so on…

The snippet again gives me the following error message:
grafik

Hello Yannick,
Thank you for sending the snippet. Looks like the issue occurs because Gantt wants to unselect a resource and if there are different IDs, it fails.
I will add it as a bug in our internal tracker, and the dev team will fix it.
Unfortunately, I cannot give you any ETA, but here is a workaround:
Unselect the row before using the gantt.clearAll() command:

gantt.getDatastore("resource").unselect()

Here is the updated snippet:
http://snippet.dhtmlx.com/5/c3fd04057

1 Like

Hello ramil,

It looks good. Since I use the unselect method I don’t get an error anymore.
Nevertheless I still have the question: When will there be a documentation of the datastore api?

Hello Yannick,
Unfortunately, I cannot give you any ETA, but I reminded the dev team about it.

Hello Yannick,

The dev team fixed the bug with the resource ID selection:
https://docs.dhtmlx.com/gantt/whatsnew.html#7012
Now, if you select a resource and load a new resource dataset, clicking on another resource row doesn’t cause an error.
You can check how it works in the following snippet:
https://snippet.dhtmlx.com/5/c8e828193