Our state of the art Gantt chart


Post by shaveta »

Hi,

I have integrated https://www.bryntum.com/examples/gantt/advanced/ example, For loading the data i am making use of load method.

Can you please explain me how the sync is working/ when it get trigger? Does it carries data from gantt to server and then updated data back to gantt?
Any example/documentation to send(save) data from gantt to server would be helpful


Post by pmiklashevich »

Hello!

Does it carries data from gantt to server and then updated data back to gantt?

Yes, that's correct. Please check out our guides:
https://www.bryntum.com/docs/gantt/#guides/project_data.md
https://www.bryntum.com/docs/gantt/#guides/crud_manager.md

Best,
Pavel

Pavlo Miklashevych
Sr. Frontend Developer


Post by shaveta »

Thanks Pavel, I am using below code

const project = new ProjectModel({

// Let the Project know we want to use our own Task model with custom fields / methods
taskModelClass : Task,
transport      : {
    load : {
        url       : 'https://localhost:3000/api/loaddata', 
        // HTTP request parameter used to pass serialized "load"-requests
        paramName : 'data',
        // specify Content-Type for "load" requests
        method      : 'GET',
        credentials : 'omit',
        cache       : 'no-cache'
    },
    sync : {
        url       : 'https://localhost:3000/api/sync', 
        // HTTP request parameter used to pass serialized "load"-requests
        paramName : 'data',
        method      : 'POST',
        credentials : 'omit',
        cache       : 'no-cache'
    }
}
});

It loads data perfectly, but sync never get triggered. Any additional changes in code are required to trigger sync?


Post by pmiklashevich »

Pavlo Miklashevych
Sr. Frontend Developer


Post by shaveta »

When i set autosync to true the sync code get triggers automatically when changes are made but i want to trigger sync code on click of save button so autosync will not be set.

How this can be achieved?


Post by mats »

Pavel explained what you should do. If you don't want autoSync, set it to false and call 'sync' when you need.


Post by shaveta »

mats wrote: Wed Sep 02, 2020 3:13 pm

Pavel explained what you should do. If you don't want autoSync, set it to false and call 'sync' when you need.

Thanks Mats, but my question is, is there any example or documentation on this?
In ExtJS gantt i am making use of modified stores to handle this but here i am unable to find how to send all updated data to server.

It would be great if you can share some example


Post by sergey.maltsev »

Hi!

PHP demo within distributions zip shows how to use manual project.sync().
Check examples/gantt/php/readme.md for setup instructions.


Post by shaveta »

sergey.maltsev wrote: Thu Sep 03, 2020 8:28 am

Hi!

PHP demo within distributions zip shows how to use manual project.sync().
Check examples/gantt/php/readme.md for setup instructions.

Thanks!!

I am using node api as backend and on sending request to api i don't see revision parameter.How the revision between server and client works? is there any parameter to get revision on gantt side that can be send to server and it get incremented on server side?


Post by alex.l »

Hi shaveta,

An example, mentioned above does have this implemented. Please, review it to see how it can be done.
Shortly, revision behaviour should be implemented by yourself on server side.

All best,
Alex

All the best,
Alex


Post Reply