Our state of the art Gantt chart


Post by hien.nguyen »

Hi team,

I'd like to update task in chart when I update task in my server side. EX: I've Task 1 display in chart, then I edit name to Task 1 edit and I want chart refresh to display Task 1 edit.

Current I can use

gantt.project.load()

to refresh but it refresh all tasks.

Please share me the way to refresh only 1 task.

Best regards.


Post by tasnim »

Hello,
You could use https://bryntum.com/products/gantt/docs/api/Gantt/model/ProjectModel#config-syncUrl and set your sync Url and then you can set https://bryntum.com/products/gantt/docs/api/Gantt/model/ProjectModel#config-autoSync to true So that it will sync every time you make any changes.

Good Luck :),
Tasnim


Post by hien.nguyen »

Thanks but it not working for me, my config as

const project = new ProjectModel({
  autoLoad: true,
  autoSync: true,
  autoSyncTimeout: 5000,
  transport: {
      load: {          
url: "https://localhost:3001/test" }, sync : {
url: "https://localhost:3001/sync" } }, validateResponse : true });

I already change data for my api https://localhost:3001/test but chart not refresh my data.

Best regards.


Post by tasnim »

You would need to enable https://bryntum.com/products/gantt/docs/api/Core/data/mixin/StoreSync#config-syncDataOnLoad for eventStore. This should work for you.


Post by hien.nguyen »

Still not work for me, I config as

load: {          
url: "https://localhost:3001/test" },

Do we have some way to fore above api https://localhost:3001/test reload again? because when I've some change data in server side I need my chart update it auto.

Best regards.


Post by alex.l »

because when I've some change data in server side I need my chart update it auto.

You need to use WebSocket to have these functionality. It's more about client-server technology than about our code.
https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API

We have an example of using WebSockets with the Scheduler, reviewing it will help you with your development https://bryntum.com/products/schedulerpro/examples-scheduler/websockets/

All the best,
Alex


Post Reply