taskLevel

Returns the level of the task in the hierarchy. 0 for root-level tasks.

Parameters

task kendo.data.GanttTask

The reference task.

Returns

Number—The level of the task in the hierarchy.

Example - get the level 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")
      }
    ]
  });

  dataSource.fetch();

/* The result can be observed in the DevTools(F12) console of the browser. */
  console.log(dataSource.taskLevel(dataSource.at(1))) // outputs "1"
</script>
In this article