Gantt doesn't update after lag update

When I change the lag for a link, the gantt does not update. However, if I change the dependency type of the lag, it works fine.

I am using the PRO version of the gantt. I have auto_scheduling and auto_scheduling_strict set to true.

I have a custom modal for updating links using the ‘onLinkDblClick’ that updates the link with the given values:

const link = gantt.getLink(id);
link.type = dependencyType;
link.lag = lag;
gantt.updateLink(link.id);

If I look at gantt.getLinks() before and after the update, I see that the link value updates correctly (the lag value changes). However, the task does not get re-scheduled on the gantt.

I added the onAfterAutoSchedule event and added a console.log(taskId) to make sure it was working. It printed {taskID: 2}, so I know that auto schedule is running but not doing anything.

Do you have any suggestions of how to further debug this and get tasks to update when their links’ lag changes?

1 Like

Hello Glen,
We received your ticket in the support system. Let’s discuss the question there, and here we can post the final solution.

Hi, ramil, may i know the solution, could you help to send me a mail, Thanks.

Hello Weis,
I couldn’t reproduce the issue on the client-side:

http://snippet.dhtmlx.com/07c6aa644

Do you have the lag column in the database? If you don’t have it, that parameter won’t be saved on the server-side.

Hi ramil,

I mean when I drag the task the lag between two tasks not update, is that need to manually update it by gantt.getLinks()?

Hello Weis,
The lag parameter is used to specify the number of duration units(days or hours) between tasks. If you use the autoscheduling functionality, Gantt will keep that duration between tasks when you move the predecessor task.
If you use the critical path functionality, the lag parameter is considered when Gantt decides if the task should be critical or not.
If you don’t use those features, the lag parameter doesn’t affect anything else. And it doesn’t really reflect the actual duration between tasks.