Edit this page

taskSiblings

Returns a list of all tasks that have the same parent.

Parameters

task kendo.data.GanttTask

The reference task.

Returns

Array the list of all tasks with the same parent as the parameter task. If the parameter task is a root level task, all root level tasks are returned.

Example - get the siblings 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",
        start: new Date("2014/6/17 9:00"),
        end: new Date("2014/6/17 11:00")
      },
      {
        id: 3,
        orderId: 1,
        parentId: 1,
        title: "Task3",
        start: new Date("2014/6/17 12:00"),
        end: new Date("2014/6/17 13:00")
      }
    ]
  });

  dataSource.fetch();

  // returns a list with the two sibling tasks.
  var childTasks = dataSource.taskSiblings(dataSource.at(1));
</script>
Is this article helpful? Yes / No
Thank you for your feedback!

Give article feedback

Tell us how we can improve this article

close
Dummy