groupedItemsTree

Builds and returns an items tree when grouping is enabled.

Parameters

groupField String

The field the items should be grouped by.

Returns

Array An array featuring the tree-like hierarchy in the source.

Example

<script>
  var dataSource = new kendo.data.OrgChartDataSource({
      transport: {
              read: {
              url: "https://demos.telerik.com/kendo-ui/service/EmployeeDirectory/All",
              dataType: "jsonp"
          }
      },
      schema: {
          model: {
              id: "EmployeeId",
              parentId: "ReportsTo",
              fields: {
                  EmployeeId: { type: "number", nullable: false },
                  ReportsTo: { field: "ReportsTo", nullable: true },
                  title: { field: "Position", nullable: true },
                  name: { field: "FirstName", nullable: true }
              },
              expanded: true
          }
      }
  });

    dataSource.read().then(function() {
      var tree = dataSource.groupedItemsTree("Title");

      console.log(tree);
    });
</script>
In this article