1 <div class="apiDetail">
\r
3 <h2><span>Boolean</span><span class="path">treeNode.</span>open</h2>
\r
4 <h3>Overview<span class="h3_info">[ depends on <span class="highlight_green">jquery.ztree.core</span> js ]</span></h3>
\r
7 <div class="longdesc">
\r
8 <p>Used to record the parent node's expand status.</p>
\r
9 <p class="highlight_red">1. When zTree initialize the node data, if you set treeNode.open = true, zTree will default expand this parent node.</p>
\r
10 <p class="highlight_red">2. Leaf node's 'open' attribute is false.</p>
\r
11 <p class="highlight_red">3. In order to solve the problem of someone make json data, supporting "false", "true" format of the data string.</p>
\r
12 <p class="highlight_red">4. When setting.async.enable = false, the parent node will be expanded which have no child nodes and its attribute 'open' is true. (v3.5.15+) </p>
\r
13 <p>Default: false</p>
\r
16 <h3>Boolean Format</h3>
\r
18 <p> true means: the parent node is expanded.</p>
\r
19 <p> false means: the parent node is collapsed.</p>
\r
21 <h3>Examples of treeNode</h3>
\r
22 <h4>1. Get the first selected node's expand status.</h4>
\r
23 <pre xmlns=""><code>var treeObj = $.fn.zTree.getZTreeObj("tree");
\r
24 var sNodes = treeObj.getSelectedNodes();
\r
25 if (sNodes.length > 0) {
\r
26 var isOpen = sNodes[0].open;
\r