Function(node, disabled)zTreeObj.setChkDisabled

Overview[ depends on jquery.ztree.excheck js ]

Set the node's checkbox or radio is disabled or remove disabled. It is valid when [setting.check.enable = true]

1. After the node's checkbox / radio is disabled, it can not be checked or unchecked, but it can affect the half-checked status of the parent node.

2. Please do not directly modify the 'chkDisabled' attribute of the loaded node.

3. Please use zTree object to executing the method.

Function Parameter Descriptions

treeNodeJSON

JSON data object of the node which need to be checked or unchecked.

Please ensure that this data object is an internal node data object in zTree.

disabledBoolean

disabled = true means: the node's checkbox / radio is disabled.

disabled = false means: the node's checkbox / radio is removed disabled.

If this parameter is omitted, it is same as disabled = false

Don't affect the node which 'nochecked' attribute is true.

Return none

no return value

Examples of function

1. Set the selected nodes's checkbox / radio to be disabled.

var treeObj = $.fn.zTree.getZTreeObj("tree");
var nodes = treeObj.getSelectedNodes();
for (var i=0, l=nodes.length; i < l; i++) {
	treeObj.setChkDisabled(nodes[i], true);
}