taskAllChildren
Returns a list of all child tasks. The search is recursive.
Parameters
task kendo.data.GanttTask
(optional)
The parent task. If this parameter is not specified, all Gantt tasks will be returned.
Returns
Array
—The list of all child tasks.
Example - get all children of a task
<script>
var dataSource = new kendo.data.GanttDataSource({
data: [
{
id: 1,
orderId: 0,
parentId: null,
title: "Task1",
summary: true,
start: new Date("2014/6/17 9:00"),
end: new Date("2014/6/17 11:00")
},
{
id: 2,
orderId: 0,
parentId: 1,
title: "Task2",
summary: true,
start: new Date("2014/6/17 9:00"),
end: new Date("2014/6/17 11:00")
},
{
id: 3,
orderId: 0,
parentId: 2,
title: "Task3",
start: new Date("2014/6/17 9:00"),
end: new Date("2014/6/17 11:00")
}
]
});
dataSource.fetch();
// returns a list of the two child tasks.
var childTasks = dataSource.taskAllChildren(dataSource.at(0));
</script>
Example - get all Gantt tasks
<script>
var dataSource = new kendo.data.GanttDataSource({
data: [
{
id: 1,
orderId: 0,
parentId: null,
title: "Task1",
summary: true,
start: new Date("2014/6/17 9:00"),
end: new Date("2014/6/17 11:00")
},
{
id: 2,
orderId: 0,
parentId: 1,
title: "Task2",
summary: true,
start: new Date("2014/6/17 9:00"),
end: new Date("2014/6/17 11:00")
},
{
id: 3,
orderId: 0,
parentId: 2,
title: "Task3",
start: new Date("2014/6/17 9:00"),
end: new Date("2014/6/17 11:00")
}
]
});
dataSource.fetch();
// returns a list of all three tasks.
var childTasks = dataSource.taskAllChildren();
</script>