bitreenode.html

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

HTML
630
字号
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html><!--Generated using api.website.xsl version 2003-07-17--><head><META http-equiv="Content-Type" content="text/html; charset=utf-8"><title>BiTreeNode</title><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><link type="text/css" rel="stylesheet" href="api.css"><script type="text/javascript">				function showDerivedClasses() {					var ul = document.getElementById("api-derived-classes");					var lis = ul.childNodes;					var l = lis.length;					for (var i = 1; i < l; i++)						lis[i].style.display = "";					lis[0].style.display = "none";				}			</script></head><body><h1 id="BiTreeNode">BiTreeNode</h1><p>This represents a tree node for a <code><a href="BiTree.html">tree</a></code> or a row for a <code><a href="BiTree.html">tree</a></code>. A tree node is not a component but it has some visual properties that are similar to a <code><a href="BiComponent.html">component</a></code>.<br>				<br>		 When working with trees and column list it is usually suitable to extend this class instead of using it directly because this gives better control over what data is bound to the node and what text to show on the row.</p><p>This class extends		<code><a href="BiAbstractGridRow.html">BiAbstractGridRow</a></code>		and therefore all methods and fields available for		<code><a href="BiAbstractGridRow.html">BiAbstractGridRow</a></code>		are also available for <code>BiTreeNode</code>.</p><ul class="partial-class-tree"><li><code><a href="BiObject.html">BiObject</a></code><ul><li><code><a href="BiAbstractGridRow.html">BiAbstractGridRow</a></code><ul><li><code>BiTreeNode</code><ul id="api-derived-classes"></ul></li></ul></li></ul></li></ul><h2>Constructor</h2><p><code>	new BiTreeNode([<span class="methodArgument">oData</span>])</code></p><h3>Parameters</h3><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>oData</code></td><td><code class="type">Object[]</code></td><td class="optional-column"><img src="check.png" alt="checked"></td><td><code>[]</code></td><td>This is an array containing the data to be used for each column. </td></tr></tbody></table><h2>Properties</h2><table><thead><tr><td>Name</td><td>Type</td><td class="get-header">get</td><td class="set-header">set</td><td>Descripton</td></tr></thead><tbody><tr><td><a name="cssClassName"></a><code>cssClassName</code></td><td><code class="type">String</code></td><td class="get-column"><img src="check.png" alt="checked"></td><td class="set-column"></td><td>Returns the CSS class name used for the row of the node.</td></tr><tr><td><a name="depth"></a><code>depth</code></td><td><code class="type">Number</code></td><td class="get-column"><img src="check.png" alt="checked"></td><td class="set-column"></td><td>The depth of the tree</td></tr><tr><td><a name="expanded"></a><code>expanded</code></td><td><code class="type">Boolean</code></td><td class="get-column"><img src="check.png" alt="checked"></td><td class="set-column"><img src="check.png" alt="checked"></td><td>Whether the node is expanded or not.</td></tr><tr><td><a name="expandIconHtml"></a><code>expandIconHtml</code></td><td><code class="type">String</code></td><td class="get-column"><img src="check.png" alt="checked"></td><td class="set-column"></td><td>Returns the HTML used to draw the expand icon.</td></tr><tr><td><a name="expandIconSrc"></a><code>expandIconSrc</code></td><td><code class="type">String</code></td><td class="get-column"><img src="check.png" alt="checked"></td><td class="set-column"></td><td>Returns the URI to the image file that should be used for the expand icon.</td></tr><tr><td><a name="firstNode"></a><code>firstNode</code></td><td><code class="type">				<code><a href="BiTreeNode.html">BiTreeNode</a></code>			</code></td><td class="get-column"><img src="check.png" alt="checked"></td><td class="set-column"></td><td>Returns the first child node.</td></tr><tr><td><a name="grid"></a><code>grid</code></td><td><code class="type">				<code><a href="BiTree.html">BiTree</a></code>			</code></td><td class="get-column"><img src="check.png" alt="checked"></td><td class="set-column"></td><td>Returns the tree component that the node is part of. Same as <code><a href="#tree">tree</a></code>			</td></tr><tr><td><a name="html"></a><code>html</code></td><td><code class="type">String</code></td><td class="get-column"><img src="check.png" alt="checked"></td><td class="set-column"></td><td>Returns the HTML for the node and all its children. This is used by the <code><a href="BiTree.html#treeBodyHtml">BiTree treeBodyHtml property</a></code> when drawing the tree.</td></tr><tr><td><a name="iconHtml"></a><code>iconHtml</code></td><td><code class="type">String</code></td><td class="get-column"><img src="check.png" alt="checked"></td><td class="set-column"></td><td>Returns the HTML used to draw the icon.</td></tr><tr><td><a name="lastNode"></a><code>lastNode</code></td><td><code class="type">				<code><a href="BiTreeNode.html">BiTreeNode</a></code>			</code></td><td class="get-column"><img src="check.png" alt="checked"></td><td class="set-column"></td><td>Returns the last child node.</td></tr><tr><td><a name="level"></a><code>level</code></td><td><code class="type">Number</code></td><td class="get-column"><img src="check.png" alt="checked"></td><td class="set-column"></td><td>The level of indention for the tree.</td></tr><tr><td><a name="nextSiblingNode"></a><code>nextSiblingNode</code></td><td><code class="type">				<code><a href="BiTreeNode.html">BiTreeNode</a></code>			</code></td><td class="get-column"><img src="check.png" alt="checked"></td><td class="set-column"></td><td>* Returns the next tree node sibling (if any).</td></tr><tr><td><a name="nodes"></a><code>nodes</code></td><td><code class="type">				<code><a href="BiTreeNode.html">BiTreeNode[]</a></code>			</code></td><td class="get-column"><img src="check.png" alt="checked"></td><td class="set-column"></td><td>Returns all the child nodes.</td></tr><tr><td><a name="parentNode"></a><code>parentNode</code></td><td><code class="type">				<code><a href="BiTreeNode.html">BiTreeNode</a></code> /<code><a href="BiTree.html">BiTree</a></code>			</code></td><td class="get-column"><img src="check.png" alt="checked"></td><td class="set-column"></td><td>Returns the parent tree node.</td></tr><tr><td><a name="previousSiblingNode"></a><code>previousSiblingNode</code></td><td><code class="type">				<code><a href="BiTreeNode.html">BiTreeNode</a></code>			</code></td><td class="get-column"><img src="check.png" alt="checked"></td><td class="set-column"></td><td>Returns the previous tree node sibling (if any).</td></tr><tr><td><a name="rowHtml"></a><code>rowHtml</code></td><td><code class="type">String</code></td><td class="get-column"><img src="check.png" alt="checked"></td><td class="set-column"></td><td>Returns the HTML for the row of the node. This does not include any of the child nodes for the tree node.</td></tr><tr><td><a name="tree"></a><code>tree</code></td><td><code class="type">				<code><a href="BiTree.html">BiTree</a></code>			</code></td><td class="get-column"><img src="check.png" alt="checked"></td><td class="set-column"></td><td>Returns the tree component that the node is part of</td></tr></tbody></table><h2>Methods</h2><table><thead><tr><td>Name</td><td>Description</td></tr></thead><tbody><tr><td><code><a href="#addNode">addNode</a></code></td><td>Adds a tree node as a child to the current tree node</td></tr><tr><td><code><a href="#containsNode">containsNode</a></code></td><td>Whether the tree node contains another node</td></tr><tr><td><code><a href="#getCellHtml">getCellHtml</a></code></td><td>Returns the HTML for the entire cell (includes indention, expand icon and icon)</td></tr><tr><td><code><a href="#getData">getData</a></code></td><td>Returns the data for the given column index</td></tr><tr><td><code><a href="#getLabelHtml">getLabelHtml</a></code></td><td>Returns the actual HTML to show on the cell. Override this to handle specific data. The default implementation uses <code>String(treeNode.getData(nCol))</code>			</td></tr><tr><td><code><a href="#hasNodes">hasNodes</a></code></td><td>Returns true if the tree node has any child nodes</td></tr><tr><td><code><a href="#isLastSiblingNode">isLastSiblingNode</a></code></td><td>Returns true if the node has no next sibling node.</td></tr><tr><td><code><a href="#isLeaf">isLeaf</a></code></td><td>Returns true if the tree node has no child nodes</td></tr><tr><td><code><a href="#removeAll">removeAll</a></code></td><td>Removes all child nodes (and disposes them)</td></tr><tr><td><code><a href="#removeNode">removeNode</a></code></td><td>Removes a tree node child</td></tr><tr><td><code><a href="#removeNodeAt">removeNodeAt</a></code></td><td>Removes the tree node child at the given index</td></tr><tr><td><code><a href="#reveal">reveal</a></code></td><td>Expands all parent tree nodes to make this node visible</td></tr><tr><td><code><a href="#setData">setData</a></code></td><td>Sets the data for a given column index</td></tr><tr><td><code><a href="#toggle">toggle</a></code></td><td>Toggles the expand property</td></tr><tr><td><code><a href="#update">update</a></code></td><td>Updates the node and all of its children. This allows the tree to redraw only the current branch of the tree. This is useful when only a few items have changed and therefore the whole data of the tree does not need to be redrawn.</td></tr><tr><td><code><a href="#updateRow">updateRow</a></code></td><td>Updates the row of the tree node. This allows the tree to redraw only the current tree item row (the children are not redrawn). This is useful when only a few items have changed and therefore the whole data of the tree does not need to be redrawn.</td></tr></tbody></table><h2>Events</h2><p>None.</p><h2>Static Methods</h2><p>None.</p><h2>Static Fields</h2><p>None.</p><h2>Remarks</h2><p>Changing the node does not automatically update the tree. The 			<code><a href="BiTree.html">tree</a></code> will have to be updated manually.</p><h2>Method Details</h2><h3><a name="addNode"></a>addNode</h3><p>Adds a tree node as a child to the current tree node</p>

⌨️ 快捷键说明

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