Disable node from the tree.
Parameters
Name | Type | Description |
---|---|---|
node | {Object} | The node as jquery object. |
cascade | {Boolean} | Disable all children. Set to true by default. |
Examples
Sample
<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>