New to Kendo UI for jQuery? Start a free 30-day trial

TaskParent

methods

Returns the parent task of a certain task.

Parameters:taskkendo.data.GanttTask

The reference task.

Returns:kendo.data.GanttTask

—The parent 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")
      }
    ]
  });

  dataSource.fetch();

/* The result can be observed in the DevTools(F12) console of the browser. */
  console.log(dataSource.taskParent(dataSource.at(1)).title) // outputs "Task1"
</script>
<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")
      }
    ]
  });

  dataSource.fetch();

/* The result can be observed in the DevTools(F12) console of the browser. */
  console.log(dataSource.taskParent(dataSource.at(0))) // outputs "null"`
</script>
Not finding the help you need?
Contact Support