Getting all child linked tasks for a particular tasks?

Let say I have a gantt chart with multiple tasks linked together.

How do I get all child task for a tasks

A
B
E
F
C
G
H
D
I

For example

-child of A would be BEFCGHDI
-child of B would be EF
-child of C would be GH
-child of D would be I

Thanks in advance.

Hi,
if you need to get tasks which are linked to a particular one with dependence links (start to start, finish to start, etc) you’ll need to inspect ‘$source’ and ‘$target’ properties of the related task. They store outcoming and incoming links respectively. E.g.

var outcoming = task.$source; for(var i=0; outcoming.length; i++){ var link = gantt.getLink(outcoming[i]); var target = gantt.getTask(link.target); }
docs.dhtmlx.com/gantt/api__gantt_getlink.html
docs.dhtmlx.com/gantt/api__gantt_gettask.html
If you mean a children in the parent-child hierarchy, there are some api methods for that:
docs.dhtmlx.com/gantt/api__gantt … ldren.html
docs.dhtmlx.com/gantt/api__gantt_eachtask.html

Perfect - Thank you! :slight_smile: