Our state of the art Gantt chart


Post by dominikArchdesk »

Hi,
I need to reload data on my Gantt every now and then. I don't want to use the WebSocket for this.
At the moment, I've something like this:

setInterval(function() {
projectObject.load();
}, 60000);

The problem is that this causes the tasks to collapse on Gantt and changes the zoom every time. It can be annoying for the user.

So, is it possible to load data with a saving screen position state (zoom, expanded tasks etc.)?

It is a similar issue to the topic https://forum.bryntum.com/viewtopic.php?f=44&p=75518


Post by saki »

There is one way I can think of is to utilize https://bryntum.com/docs/gantt/#Core/data/mixin/StoreSync#config-syncDataOnLoad config option that you would set true on the stores (inside of the project) you need to reload.

Then try to reload the project and only that data what was changed would be updated and it should eliminate the unwanted scroll/zoom changes.

Let us please know how if it worked.


Post by dominikArchdesk »

Thanks, Saki for the quick reply, but this solution does not solve the main problem. If we have many users who work in parallel and they have to reload data (eg. every minute) they will still have a problem with collapsing tasks and changing the zoom, even if nothing has changed - Current view is lost when load() starts.

Attachments
Peek 2020-11-12 13-50.gif
Peek 2020-11-12 13-50.gif (109.08 KiB) Viewed 1733 times

Post by saki »

Would you please post a testcase that we could run and debug? If nothing has changed in the data there is no reason for Gantt to change its scroll position or zoom level or anything else. We need find out where the problem is.


Post by fabio.mazza »

Hi dominikArchdesk,

Testing on our basic demo (https://www.bryntum.com/examples/gantt/basic/), I added the config to project:

const project = new ProjectModel({
    ...
    taskStore : {
        syncDataOnLoad : false
    }
});

And then:

setInterval(function() {
    project.load();
}, 3000);

I verified it keep the zoom on load, but the collapsed tasks are changed to expanded/collapsed. Here is a feature request to track: https://github.com/bryntum/support/issues/1864

Best regards,
Fabio


Post by dominikArchdesk »

Thanks saki, fabio.policeno ;-) anything else I need to prepare? We are waiting for an answer...


Post by saki »

I have re-tested it with the above settings and reload every 3s and it behaves as you can see on attached video.

  1. Changed zoom level is not reset on reload
  2. Scroll is not affected either
  3. The expand state is reverted back but this is currently the expected behavior because expanded is a field received in the server response so when I collapse it manually (expanded:false), the next server load with expanded:true overwrites the locally changed setting. The above feature request reports the fact and will be resolved.
gantt-reload.gif
gantt-reload.gif (1.09 MiB) Viewed 1699 times

Post by yuriv »

I'm also experience mentioned here error (Entity.js:75 Uncaught Error: Already entered replica) on updating data with syncDataOnLoad: true. On first data update this error comes alone. But if we ignore it and continue to update data, starting from second update it comes with 1 or 2 friends, see attached screenshot.

Interesting fact is that it not always prevents data from being updated. Sometimes I see data updated, sometimes not.

This seems to be critical for us as we need to preserve scroll/zoom etc. on data update. I see that there is a related ticket (https://github.com/bryntum/support/issues/1864). How soon can we expect it to be fixed?

Attachments
syncDataOnLoad-errors.png
syncDataOnLoad-errors.png (110.03 KiB) Viewed 1671 times

Post by sergey.maltsev »

Hi, yuriv!

Please create your own topic to get personalized help for your problem.

We highly appreciate if you attach any runnable code so we can easily reproduce the issue.

I can't give you any timeframe for the feature request you mentioned above, but you could contact us at Professional Services https://www.bryntum.com/services/ to speedup development.


Post Reply