gantt.eachTask returns nothing when mode = move

I’m basically following one of the examples from your documentation.

[code]gantt.attachEvent(“onTaskDrag”, function(id, mode, task, original){
var modes = gantt.config.drag_mode;

		if(mode == modes.move){
			var diff = task.start_date - original.start_date;

			gantt.eachTask(function(child){
				console.log(child);
				child.start_date = new Date(+child.start_date + diff);
				child.end_date = new Date(+child.end_date + diff);
				gantt.refreshTask(child.id, true);
			}, id);
		}
		return true;
	});[/code]

Everything works until I get to gantt.eachTask. It is never called inside of modes.move. I can move the gantt.eachTask out of the move mode and it gets called many times.

Any ideas.

I believe I figured out why it’s not working. I think this example only works if the children are actually children of the parent.

I am trying to make this work when they are just linked. I would like anything that is linked to the task that is dragged to move.

Hello,
to get links related to a task, use the $source, $target properties of the task’s object. Thanks to source links and target links, you can use linked task.

Llink to documentation:
http://docs.dhtmlx.com/gantt/desktop__link_object_operations.html

Example:
http://docs.dhtmlx.com/gantt/snippet/ab7de6b1

Yes, I have tried different things with the api and can’t get it to do what I am looking to do. I posted a separate topic about this. It seems like an example of how to do this would be created. This is a common request from what I have seen.