bitree.html

来自「ajax 框价.是个好工具.javascript 矿家.可以用在任何平台.」· HTML 代码 · 共 529 行 · 第 1/2 页

HTML
529
字号
		<code>                     var tree = new<code><a href="BiTree.html">BiTree</a></code>;<br>			                     tree.setColumnCount(3);<br>			                     tree.setColumnWidths([100,50,150]);<br>						<br>			                     tree.setColumnNames(["Name", "Size", "Date"]);<br>			                     tree.setColumnSortTypes(["CaseInsensitiveString", "Number", "Date"]);<br>			                     tree.setColumnAligns(["left", "right", "left"]);<br>						<br>			                     tree.setIndentColumn(0);<br>			                     tree.setIconColumn(0);<br>						<br>			                     // add tree nodes<br>						<br>			                     parentComponent.add(tree);<br>			                     tree.update();<br>					</code>		<br>		                     Make sure that the tree is <code><a href="BiComponent.html#created">created</a></code>                     when you call the update methods or the they will not do anything. The tree                     must be updated or it will not show the tree body and/or the columns                     correctly.<br>				<br>		                     You should also be careful not to update the tree when not necessary because                     the update methods are expansive.</p><h2>Method Details</h2><h3><a name="addNode"></a>addNode</h3><p>Adds a tree node as a child to the tree</p><h4>Syntax</h4><pre class="method-syntax">object.addNode(<span class="methodArgument">oChild</span> [, <span class="methodArgument">oBefore</span>])</pre><h4>Parameters</h4><table><thead><tr><td>Name</td><td>Type</td><td class="optional-header">Optional</td><td>Default</td><td>Descripton</td></tr></thead><tbody><tr><td><code>oChild</code></td><td><code class="type">						<code><a href="BiTreeNode.html">BiTreeNode</a></code>					</code></td><td class="optional-column"></td><td></td><td>The tree node child to add</td></tr><tr><td><code>oBefore</code></td><td><code class="type">						<code><a href="BiTreeNode.html">BiTreeNode</a></code>					</code></td><td class="optional-column"><img src="check.png" alt="checked"></td><td></td><td>If provided, the child is added before this node </td></tr></tbody></table><h4>Return Type</h4><p><code class="type">void</code></p><h3><a name="containsNode"></a>containsNode</h3><p>Whether the tree contains the node</p><h4>Syntax</h4><pre class="method-syntax">object.containsNode(<span class="methodArgument">oDescendant</span>)</pre><h4>Parameters</h4><table><thead><tr><td>Name</td><td>Type</td><td class="optional-header">Optional</td><td>Default</td><td>Descripton</td></tr></thead><tbody><tr><td><code>oDescendant</code></td><td><code class="type">						<code><a href="BiTreeNode.html">BiTreeNode</a></code>					</code></td><td class="optional-column"></td><td></td><td>The node to test if it is contained</td></tr></tbody></table><h4>Return Type</h4><p><code class="type">Boolean</code></p><h3><a name="getNodeAtPoint"></a>getNodeAtPoint</h3><p>Returns the tree node at the given point. If no node is found this returns null.</p><h4>Syntax</h4><pre class="method-syntax">object.getNodeAtPoint(<span class="methodArgument">nClientX</span>, <span class="methodArgument">nClientY</span>)</pre><h4>Parameters</h4><table><thead><tr><td>Name</td><td>Type</td><td class="optional-header">Optional</td><td>Default</td><td>Descripton</td></tr></thead><tbody><tr><td><code>nClientX</code></td><td><code class="type">Number</code></td><td class="optional-column"></td><td></td><td>The left position relative to the browser window</td></tr><tr><td><code>nClientY</code></td><td><code class="type">Number</code></td><td class="optional-column"></td><td></td><td>The top position relative to the browser window</td></tr></tbody></table><h4>Return Type</h4><p><code class="type">					<code><a href="BiTreeNode.html">BiTreeNode</a></code>				</code></p><h3><a name="getRowAtPoint"></a>getRowAtPoint</h3><p>Returns the row at the given point. If no node is found this returns null. This is the same as <code><a href="#getNodeAtPoint">getNodeAtPoint</a></code>			</p><h4>Syntax</h4><pre class="method-syntax">object.getRowAtPoint(<span class="methodArgument">nClientX</span>, <span class="methodArgument">nClientY</span>)</pre><h4>Parameters</h4><table><thead><tr><td>Name</td><td>Type</td><td class="optional-header">Optional</td><td>Default</td><td>Descripton</td></tr></thead><tbody><tr><td><code>nClientX</code></td><td><code class="type">Number</code></td><td class="optional-column"></td><td></td><td>The left position relative to the browser window</td></tr><tr><td><code>nClientY</code></td><td><code class="type">Number</code></td><td class="optional-column"></td><td></td><td>The top position relative to the browser window</td></tr></tbody></table><h4>Return Type</h4><p><code class="type">					<code><a href="BiTreeNode.html">BiTreeNode</a></code>				</code></p><h3><a name="hasNodes"></a>hasNodes</h3><p>Returns true if the tree has any child nodes</p><h4>Syntax</h4><pre class="method-syntax">object.hasNodes()</pre><h4>Parameters</h4><p>No arguments.</p><h4>Return Type</h4><p><code class="type">Boolean</code></p><h3><a name="isLastSiblingNode"></a>isLastSiblingNode</h3><p>Returns true if the node has no next sibling node. This is always true for the tree component.</p><h4>Syntax</h4><pre class="method-syntax">object.isLastSiblingNode()</pre><h4>Parameters</h4><p>No arguments.</p><h4>Return Type</h4><p><code class="type">Boolean</code></p><h3><a name="isLeaf"></a>isLeaf</h3><p>Returns true if the tree has no child nodes</p><h4>Syntax</h4><pre class="method-syntax">object.isLeaf()</pre><h4>Parameters</h4><p>No arguments.</p><h4>Return Type</h4><p><code class="type">Boolean</code></p><h3><a name="removeAll"></a>removeAll</h3><p>Removes all child nodes (and disposes them)</p><h4>Syntax</h4><pre class="method-syntax">object.removeAll()</pre><h4>Parameters</h4><p>No arguments.</p><h4>Return Type</h4><p><code class="type">void</code></p><h3><a name="removeNode"></a>removeNode</h3><p>Removes a tree node child</p><h4>Syntax</h4><pre class="method-syntax">object.removeNode(<span class="methodArgument">oChild</span>)</pre><h4>Parameters</h4><table><thead><tr><td>Name</td><td>Type</td><td class="optional-header">Optional</td><td>Default</td><td>Descripton</td></tr></thead><tbody><tr><td><code>oChild</code></td><td><code class="type">						<code><a href="BiTreeNode.html">BiTreeNode</a></code>					</code></td><td class="optional-column"></td><td></td><td>The node to remove</td></tr></tbody></table><h4>Return Type</h4><p><code class="type">					<code><a href="BiTreeNode.html">BiTreeNode</a></code>				</code></p><h3><a name="reveal"></a>reveal</h3><p>Expands all parent tree nodes to make this item visible This doesn't really do anything for<code><a href="BiTree.html">BiTree</a></code> but it is provided to have the same interface as<code><a href="BiTreeNode.html">BiTreeNode</a></code>			</p><h4>Syntax</h4><pre class="method-syntax">object.reveal()</pre><h4>Parameters</h4><p>No arguments.</p><h4>Return Type</h4><p><code class="type">void</code></p></body></html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?