Enable node from the tree.
Parameters
Name | Type | Description |
---|---|---|
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)" class="gj-button-md">Enable North America (Cascade)</button>
<button onclick="tree.disable(northAmerica)" class="gj-button-md">Disable North America (Cascade)</button>
<button onclick="tree.enable(northAmerica, false)" class="gj-button-md">Enable North America (Non-Cascade)</button>
<button onclick="tree.disable(northAmerica, false)" class="gj-button-md">Disable North America (Non-Cascade)</button>
<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)" class="btn btn-default">Enable North America (Cascade)</button>
<button onclick="tree.disable(northAmerica)" class="btn btn-default">Disable North America (Cascade)</button>
<button onclick="tree.enable(northAmerica, false)" class="btn btn-default">Enable North America (Non-Cascade)</button>
<button onclick="tree.disable(northAmerica, false)" class="btn btn-default">Disable North America (Non-Cascade)</button>
<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)" class="btn btn-default">Enable North America (Cascade)</button>
<button onclick="tree.disable(northAmerica)" class="btn btn-default">Disable North America (Cascade)</button>
<button onclick="tree.enable(northAmerica, false)" class="btn btn-default">Enable North America (Non-Cascade)</button>
<button onclick="tree.disable(northAmerica, false)" class="btn btn-default">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>