There are 3 tasks connected as shown in the image. When moving one of these tasks, is there a way to move the connected task of the moving task together?
Hello Seungmin,
You can do that if you select all connected tasks and turn on the multiselect extension:
https://docs.dhtmlx.com/gantt/desktop__multiselection.html
You can see how it works in the following sample:
https://docs.dhtmlx.com/gantt/samples/02_extensions/09_multiselection.html
There is no built-in way to simultaneously move the linked tasks, but you can implement that by using Gantt API and Javascript.
For example, you can add the eachSuccessor
function to get the linked tasks:
https://docs.dhtmlx.com/gantt/desktop__dragging_dependent_tasks.html
By using it, you can update their dates and repaint the changes.
Here is an example of how it can be implemented:
http://snippet.dhtmlx.com/0ac8c01f7
Is eachTask with the parent id as second argument an equivalent of the eachSuccessor function?
Hello Obralink,
The eachTask
function cannot be an equivalent of the eachSuccessor
function.
If you specify the id
parameter in the eachTask
method, it will iterate every child task of the specified parent task. That includes direct children and the children of the deeper tree levels within the same parent task:
https://docs.dhtmlx.com/gantt/api__gantt_eachtask.html
The eachSuccessor
method will only iterate the connected successor tasks.
If you create a link from a parent task to its child tasks only, you can consider it an equivalent. But these links are not valid if the parent task has the project
type.
Also, if you connect other tasks, the eachTask
method won’t iterate them.