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

Programmatically Expand Node and Parents


Product Progress® Kendo UI® TreeView for jQuery
Operating System All
Browser All
Preferred Language JavaScript


How can I expand all parent nodes by given child node text?


  1. Find the node by its text.
  2. If the node has a parent, expand the parent.
  3. Repeat the check for a parent node until you cover all existing parent nodes.
<div class="demo-section k-content">
    <div id="treeview"></div>             
    <input type="text" id="text" placeholder="Ex. enter 'Robert King'"/>
    <button type="submit" onclick="expand()">Expand</button>
    var serviceRoot = "";
    homogeneous = new{
        transport: {
          read: {
            url: serviceRoot + "/Employees",
            dataType: "jsonp"
        schema: {
          model: {
            id: "EmployeeId",
            hasChildren: "HasEmployees"

        dataSource: homogeneous,
        loadOnDemand: false,
        dataTextField: "FullName"

    function expand(){
        var text = $('#text').val();     
        var treeview = $("#treeview").data("kendoTreeView");

        var item = treeview.findByText(text);

        if(item.length > 0){

          var parent = treeview.parent(item);
          while(parent && parent.length > 0){           
            parent = treeview.parent(parent);
In this article