Neha M
Neha M

Reputation: 1

Bryntum gantt loading and syncing data using task store

I have a taskstore thats used to load data into my gantt chart.
Like;

const taskStore = new TaskStore({
    data : [
        {
            "id"           : 1000,
            "name"         : "Cool project",
            "percentDone"  : 50,
            "startDate"    : "2019-01-02",
            "expanded"     : true,
            "children"     : [
                {
                    "id"           : 1,
                    "name"         : "A leaf node",
                    "startDate"    : "2019-01-02",
                    "percentDone"  : 50,
                    "duration"     : 10,
                }
            ]
        }
    ]
});

How can I;

  1. Autoload and sync when a new task is created using lazy loading?
  2. Sync data when a new task is created and autoload?

Upvotes: 0

Views: 124

Answers (1)

Márcio Gurka
Márcio Gurka

Reputation: 1

Assuming that you're passing the TaskStore to the project configuration of your Gantt, you need to configure the syncUrl and set autoSync property to true.

const gantt = new Gantt({
    project : {
        // Configure urls used by the built-in CrudManager
        transport : {
            sync : {
                url : 'php/sync.php'
            }
        },
        autoSync: true,
        taskStore
    }
});

Documentation Reference

Upvotes: 0

Related Questions