Our state of the art Gantt chart


Post by foursite »

Hey there,

I know this is a far fetched question but I was looking to find where Gantt does its date calculations so I can work the same logic on a sync request on our backend (PHP). I thought date calculations were done with ChronoGraph but guess that's not the case.

Thank you very much!


Post by mats »

Calculations are done by our engine which is based on ChronoGraph. You can find docs here:
https://bryntum.com/docs/gantt/#engine/gantt_events_scheduling.md
https://bryntum.com/docs/gantt/engine/


Post by foursite »

How can i make sure that startdate and enddate in db(mysql) always reflect same value which we see in gantt , because gantt applies some calculation on dates coming from db and chnages them viisually on gantt which are totaly diffrent then what we have in our db and it messes things when we use/display(php/vue) those dates anywhere else


Post by mats »

How can i make sure that startdate and enddate in db(mysql) always reflect same value which we see in gantt

If you store the data from the Gantt without modifying it, it should work just fine.

because gantt applies some calculation on dates coming from db and chnages them viisually on gantt which are totally diffrent then what we have in our db

Could you provide a runnable test case? Including a snapshot of the JSON data sent by the server, and a screenshot of how it looks?


Post by foursite »

The Gantt scheduling engine will update start and end dates of automatically scheduled events based on their constraints, links and position in the task hierarchy. This means that the startDate and endDate will be revalidated and might be recalculated as soon as the event is added or loaded to a project.

Suppose i have this in db as startDate:21-12-2020
when i load this up in gantt it applies some calculation on it and changes this date to 23-12-2020, now my backend db has date "21-12-2020" but gantt is showing "23-12-2020", that means gantt should send a sync request to server so i can update startdate in db too otherwise i have 2 diffrent dates , one is calculated (which only appears on gantt) and one which is db


Post by mats »

Did the DB value of "21-12-2020" come from our Gantt chart originally, or this value / change came from somewhere else? Sounds like value is incorrect according to our engine, the engine validates and corrects the schedule data as it enters the Gantt project.


Post by foursite »

Gantt chart displays the data which we supplies it right ? may be the date we supplied does not fits in logic of gantt and it invalidates it and correcly generate a new one and displays it in gantt but now we have diffrent/wrong date in our db/datasource , is not there must be some way that i can have same date in db/datasource too ?

the engine validates and corrects the schedule data as it enters the Gantt project.

==> and it does not sends a sync request with updated dates so i can correct the date in db , or if i have equvilanet logic to correct the dates of a task in entire tree the way gantt does in js (ours backend in laravel php )


Post by mats »

Yes if you configure your project to use autoSync, it will issue a sync request upon load. Or you can detect this manually too (check for changes after load and call sync manually).

Docs:
https://bryntum.com/docs/gantt/#Gantt/model/ProjectModel#config-autoSync
https://bryntum.com/docs/gantt/#Gantt/model/ProjectModel#function-sync


Post Reply