Hello Zhang,
In your demo, you only change the scheduling mode, then you reset the layout configuration that tells Gantt to rebuild the layout. This command is used if you change the layout configuration. After that, Gantt calls the render method to repaint the changes.
The refreshData only repaints tasks, it doesn’t do anything else. And it is not necessary to call that method as Gantt is repainted after the resetLayout method. I would replace those 2 methods with the render method if you only want to repaint tasks: https://docs.dhtmlx.com/gantt/api__gantt_render.html
If you expect that Gantt will change the task dates after you change the scheduling configuration, Gantt doesn’t work that way. For that, you need to call the autoSchedule method: https://docs.dhtmlx.com/gantt/api__gantt_autoschedule.html
Also, as the tasks already have constraints, they stay at the same dates when you switch between the scheduling modes. So, you need to remove the asap and alap constraints to reschedule tasks to earlier or later dates.
You can see that with the backward scheduling, some tasks violate the project_end date. This is a bug in Gantt. It will be fixed in the future, but I cannot give you any ETA.
Thank you,
But i find a new question.
In the schedule_from_end=true,when my duration changes, it should bu the start time that is changed instead of the end time
Please look at the examplate:
I use the default way to open the dialog,then modify the duration.
You can see that the end time has been changed
I actually schedule it backwards,expect to change the start time instead of the end time
In practice,this is my own input field instead of the default input field,but the effect is the same.
If you resize a task or change its duration in the lightbox, the logic here is that Gantt needs to keep the task on the same position. So, Gantt adds the Finish No Later Than constraint. If you don’t want to have this constraint, you can remove it.
For example, you can do that in the onAfterTaskUpdate event handler:
Hello,
You can see that with the backward scheduling, some tasks violate the project_end date.
Is there any way to change the date of a task that violates the project_end date date?