childNodes

Child nodes for model.

Parameters

model kendo.data.TreeListModel

The model whose children must be returned.

Returns

Array of the child items.

Example

<script>
  var dataSource = new kendo.data.TreeListDataSource({
    data: [
      { id: 1, Name: "Daryl Sweeney", Position: "CEO", Phone: "(555) 924-9726", parentId: null },
      { id: 2, Name: "Guy Wooten", Position: "Chief Technical Officer", Phone: "(438) 738-4935", parentId: 1 },
      { id: 3, Name: "Priscilla Frank", Position: "Chief Product Officer", Phone: "(217) 280-5300", parentId: 1 }
    ],
    schema: {
      model: {
        id: "id",
        expanded: true
      }
    }
  });

  dataSource.read();

  var firstNode = dataSource.view()[0];
  var childNodes = dataSource.childNodes(firstNode);
/* The result can be observed in the DevTools(F12) console of the browser. */
  console.log(childNodes); // returns an array of the child nodes of the first node
</script>
In this article