enableReturns: jQuery Object

Enable node from the tree.

Parameters

NameTypeDescription
node {Object} The node as jquery object.
cascade {Boolean} Enable all children. Set to true by default.

Examples

Material Design

    
 <button onclick="tree.enable(northAmerica)">Enable North America (Cascade)</button>
 <button onclick="tree.disable(northAmerica)">Disable North America (Cascade)</button>
 <button onclick="tree.enable(northAmerica, false)">Enable North America (Non-Cascade)</button>
 <button onclick="tree.disable(northAmerica, false)">Disable North America (Non-Cascade)</button>
 <br/><br/>
 <div id="tree" data-source="/Locations/Get"></div>
 <script>
     var tree, northAmerica;
     tree = $('#tree').tree({
         checkboxes: true,
         primaryKey: 'ID',
         dataBound: function () {
             northAmerica = tree.getNodeByText('North America');
         }
     });
 </script>

  

Bootstrap

    
 <button onclick="tree.enable(northAmerica)">Enable North America (Cascade)</button>
 <button onclick="tree.disable(northAmerica)">Disable North America (Cascade)</button>
 <button onclick="tree.enable(northAmerica, false)">Enable North America (Non-Cascade)</button>
 <button onclick="tree.disable(northAmerica, false)">Disable North America (Non-Cascade)</button>
 <br/><br/>
 <div id="tree" data-source="/Locations/Get"></div>
 <script>
     var tree, northAmerica;
     tree = $('#tree').tree({
         checkboxes: true,
         primaryKey: 'ID',
         uiLibrary: 'bootstrap',
         dataBound: function () {
             northAmerica = tree.getNodeByText('North America');
         }
     });
 </script>

  

Bootstrap 4

    
 <button onclick="tree.enable(northAmerica)">Enable North America (Cascade)</button>
 <button onclick="tree.disable(northAmerica)">Disable North America (Cascade)</button>
 <button onclick="tree.enable(northAmerica, false)">Enable North America (Non-Cascade)</button>
 <button onclick="tree.disable(northAmerica, false)">Disable North America (Non-Cascade)</button>
 <br/><br/>
 <div id="tree" data-source="/Locations/Get"></div>
 <script>
     var tree, northAmerica;
     tree = $('#tree').tree({
         checkboxes: true,
         primaryKey: 'ID',
         uiLibrary: 'bootstrap4',
         iconsLibrary: 'fontawesome',
         dataBound: function () {
             northAmerica = tree.getNodeByText('North America');
         }
     });
 </script>