Strong link between the two tasks

Hello to all.
I need to use a strong link between the two tasks.
For example:I have a Task#2 which execute after Task#1. If I change the start time or duration Task #1, I need to automatically change the start time Task#2.
Have any idea how to do it?

Hi,

I can do this automatically removing fields ‘start_date’ and ‘duration’ …

I created the following function to execute before I use the parse method:

window.treatTasks = function (dados) {
var arr_dados = {};
var new_dados = dados.data;
$.each(dados[‘data’],function (key,obj){
parent_id = obj.parent;
$.each(dados.data,function (key_, obj_){
if (obj_.id === parent_id){
delete new_dados[key_][‘duration’];
delete new_dados[key_][‘start_date’];
return;
}
});
});
arr_dados.links = dados.links;
arr_dados.data = new_dados;
return arr_dados;
};

gantt.init(“gantt_here”);
tasks = window.treatTasks(var_gantt);
gantt.parse (tasks);

guess helped :slight_smile:

there a better way?

Can be done through events, there is a onAfterTaskUpdate event, which will fire after any task is changed.
docs.dhtmlx.com/gantt/api__gantt … event.html

It possible to assign a code to the event, that will update the dates of related tasks.