Making changes triggered from the backend

I need to support changes to tasks dates that are triggered by a cron job that is running on the backend. I would like to use DHTMLX to take care of the changes and re-calculations of the tasks dates. What is the best way to achieve this task?

Hello Shimon,
Unfortunately, there is no way to run Gantt on the backend or outside the browser.
If you can use the cron job to launch the browser, you can use Gantt API to recalculate the dates.

1 Like

Assuming I launch a browser to do the job of updating the dates, is there a way to get the new slacks and critical path information?

Hello Shimon,
Yes, you can use the getFreeSlack and getTotalSlack methods:
https://docs.dhtmlx.com/gantt/api__gantt_getfreeslack.html
https://docs.dhtmlx.com/gantt/api__gantt_gettotalslack.html
To check if the link or task is critical, you can use the isCriticalTask and isCriticalLink methods:
https://docs.dhtmlx.com/gantt/api__gantt_iscriticaltask.html
https://docs.dhtmlx.com/gantt/api__gantt_iscriticallink.html
You can read more about critical path calculation in the following article:
https://docs.dhtmlx.com/gantt/desktop__critical_path.html