When a milestone is auto_schedule=false, if the milestone has a pre-set task, how can I keep the end time of the pre-set task from exceeding the start time of the milestone?

Hello,
When a milestone is auto_schedule=false, if the milestone has a pre-set task, how can I keep the end time of the pre-set task from exceeding the start time of the milestone?

look here,

  • This task milstone11 is auto_schedule=false,predecessor = 4,
  • The predecessor of Task #2 is 3
    How do I keep task#1 and task#2 from ending after the start of milstone11?
    Do the same if there are other tasks to the left of the milestone.
    Achieve the following effect.

https://snippet.dhtmlx.com/m5jk9oye

Hello,
Gantt doesn’t have a built-in functionality for that. You need to implement a custom solution by using the Gantt API and Javascript.

The following example can help you to start implementing your solution:
https://snippet.dhtmlx.com/cw5hvv36

It helped me a lot.

Thank you very much

1 Like

Hello,
Why can task5 be changed?I looked for a while and couldn’t find the reason.
When I added the link again, I found that the start date was the time that had not been changed during the drag

https://snippet.dhtmlx.com/kr46epnk

22

Hello,
Task #5 is linked to the task #2:


So, it is expected that it is moved to another date.

After you drag task #1 and call the correctTaskDates function in the onBeforeTaskUpdate event handler, it modifies the dates of the task. It works for tasks #1 and #2 as their successor is a milestone. But the function is not called for tasks #5 and #6 because there is no successor milestone for them.

Hello,@ramil
Can you give me a hand?
When Task #2 is connected to milstone11,Milstone11 has been set to auto_scheduling = false, how can Task #2 be dragged without affecting the connected tasks associated with Task #2
Take a look at this step:
1、Milstone11 has been set to auto_scheduling = false,
2、Drag Task #2
3、The Task #5 date will be affected.Actually trying to stay still
4、Add a line to connect the end date of Task #2 to the start time of Task #6,as shown below.The date of Task #6 is affected by the dragging of the previous Task #2, and in fact the date of Task #2 is not the latest value
5、When Task #2 is connected to milstone11,Milstone11 has been set to auto_scheduling = false, how can Task #2 be dragged without affecting the connected tasks associated with Task #2

https://snippet.dhtmlx.com/9718lqer

task #2 cannot exceed the milestone time and the corresponding tasks associated with it cannot be affected

Hello,
It seems that the successor tasks are auto-scheduled to a future date after dragging the predecessor task because of its constraint date. So, Gantt will always try to move them to a future date. And during that process, the dates of the task #2 are corrected, that’s why it looks as something unexpected.
To fix that, you need to modify the constraint_date property.
Here is the updated snippet:
https://snippet.dhtmlx.com/30yuzhrk

Hello,the above code I found to be fine in version 7.1.13