CLIENT GUI Framework
[vnfsdk/refrepo.git] / portal-common / src / main / webapp / common / thirdparty / zTree / api / en / zTreeObj.setChkDisabled.html
1 <div class="apiDetail">\r
2 <div>\r
3         <h2><span>Function(node, disabled, inheritParent, inheritChildren)</span><span class="path">zTreeObj.</span>setChkDisabled</h2>\r
4         <h3>Overview<span class="h3_info">[ depends on <span class="highlight_green">jquery.ztree.excheck</span> js ]</span></h3>\r
5         <div class="desc">\r
6                 <p></p>\r
7                 <div class="longdesc">\r
8                         <p>Set the node's checkbox or radio is disabled or remove disabled. It is valid when <span class="highlight_red">[setting.check.enable = true]</span></p>\r
9                         <p class="highlight_red">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.</p>\r
10                         <p class="highlight_red">2. Please do not directly modify the 'chkDisabled' attribute of the loaded node.</p>\r
11                         <p class="highlight_red">3. Please use zTree object to executing the method.</p>\r
12                 </div>\r
13         </div>\r
14         <h3>Function Parameter Descriptions</h3>\r
15         <div class="desc">\r
16         <h4><b>treeNode</b><span>JSON</span></h4>\r
17         <p>JSON data object of the node which need to be checked or unchecked.</p>\r
18         <p class="highlight_red">Please ensure that this data object is an internal node data object in zTree.</p>\r
19         <h4 class="topLine"><b>disabled</b><span>Boolean</span></h4>\r
20         <p>disabled = true means: the node's checkbox / radio is disabled.</p>\r
21         <p>disabled = false means: the node's checkbox / radio is removed disabled.</p>\r
22         <p class="highlight_red">If this parameter is omitted, it is same as disabled = false </p>\r
23         <p class="highlight_red">Don't affect the node which 'nochecked' attribute is true.</p>\r
24         <h4 class="topLine"><b>inheritParent</b><span>Boolean</span></h4>\r
25         <p>inheritParent = true means: all parent nodes's disabled status will be same as this node.</p>\r
26         <p>inheritParent = false means: all parent nodes's disabled status will be not affected.</p>\r
27         <p class="highlight_red">If this parameter is omitted, it is same as 'inheritParent = false'</p>\r
28         <h4 class="topLine"><b>inheritChildren</b><span>Boolean</span></h4>\r
29         <p>inheritChildren = true means: all child nodes's disabled status will be same as this node.</p>\r
30         <p>inheritChildren = false means: all child nodes's disabled status will be not affected.</p>\r
31         <p class="highlight_red">If this parameter is omitted, it is same as 'inheritChildren = false'</p>\r
32         <h4 class="topLine"><b>Return </b><span>none</span></h4>\r
33         <p>no return value</p>\r
34         </div>\r
35         <h3>Examples of function</h3>\r
36         <h4>1. Set the selected nodes's checkbox / radio to be disabled.</h4>\r
37         <pre xmlns=""><code>var treeObj = $.fn.zTree.getZTreeObj("tree");\r
38 var nodes = treeObj.getSelectedNodes();\r
39 for (var i=0, l=nodes.length; i < l; i++) {\r
40         treeObj.setChkDisabled(nodes[i], true);\r
41 }\r
42 </code></pre>\r
43 </div>\r
44 </div>