expandReturns: jQuery object

Expand node from the tree.

Parameters

NameTypeDescription
node {object} The node as jQuery object
cascade {boolean} Expand all children

Examples

Method Sample

    
 <button onclick="expand()" class="gj-button-md">Expand Asia</button>
 <button onclick="collapse()" class="gj-button-md">Collapse Asia</button>
 <br/>
 <div id="tree"></div>
 <script>
     var tree = $('#tree').tree({
         dataSource: '/Locations/Get'
     });
     function expand() {
         var node = tree.getNodeByText('Asia');
         tree.expand(node);
     }
     function collapse() {
         var node = tree.getNodeByText('Asia');
         tree.collapse(node);
     }
 </script>

  

Cascade

    
 <button onclick="expand()" class="gj-button-md">Expand North America</button>
 <br/>
 <div id="tree"></div>
 <script>
     var tree = $('#tree').tree({
         dataSource: '/Locations/Get'
     });
     function expand() {
         var node = tree.getNodeByText('North America');
         tree.expand(node, true);
     }
 </script>