The base class for all tree nodes. The node's presentation and behavior in
response to mouse events is handled in Node subclasses.
|
children : Node[] |
Node |
This node's child node collection. |
|
childrenRendered : boolean |
Node |
This flag is set to true when the html is generated for this node's
children, and set to false when new children are ... |
|
data : object |
Node |
The data linked to this node. This can be any object or primitive
value, and the data can be used in getNodeHtml(). |
|
dataLoader : function |
Node |
Function to execute when we need to get this node's child data. |
|
depth : int |
Node |
The depth of this node. We start at -1 for the root node. |
|
dynamicLoadComplete : boolean |
Node |
Dynamically loaded nodes only fetch the data the first time they are
expanded. This flag is set to true once the dat... |
|
expanded : boolean |
Node |
The node's expanded/collapsed state |
|
hasIcon : boolean |
Node |
The toggle/branch icon will not show if this is set to false. This
could be useful if the implementer wants to have ... |
|
href : string |
Node |
The href for the node's label. If one is not specified, the href will
be set so that it toggles the node. |
|
iconMode : int |
Node |
Used to configure what happens when a dynamic load node is expanded
and we discover that it does not have children. ... |
|
index : int |
Node |
The index for this instance obtained from global counter in YAHOO.widget.TreeView. |
|
isLoading : boolean |
Node |
This is true for dynamically loading nodes while waiting for the
callback to return. |
|
multiExpand : boolean |
Node |
Can multiple children be expanded at once? |
|
nextSibling : Node |
Node |
This node's next sibling |
|
parent : Node |
Node |
Parent node |
|
previousSibling : Node |
Node |
This node's previous sibling |
|
renderHidden : boolean |
Node |
Should we render children for a collapsed node? It is possible that the
implementer will want to render the hidden d... |
|
target : string |
Node |
The label href target, defaults to current window |
|
tree : TreeView |
Node |
Tree instance this node is part of |
|
Node() |
Node |
|
|
appendTo(parentNode {Node} ) : Node |
Node |
Appends this node to the supplied node's child collection |
|
applyParent(Node parentNode ) : boolean |
Node |
Certain properties for the node cannot be set until the parent
is known. This is called after the node is inserted in... |
|
collapse() : void |
Node |
Hides this nodes children (creating them if necessary), changes the
toggle style. |
|
collapseAll() : void |
Node |
Recursively collapses all of this node's children. |
|
completeRender() : string |
Node |
Called when we know we have all the child data. |
|
expand() : void |
Node |
Shows this nodes children (creating them if necessary), changes the
toggle style, and collapses its siblings if multi... |
|
expandAll() : void |
Node |
Recursively expands all of this node's children. |
|
getAncestor(int depth ) : Node |
Node |
Returns this node's ancestor at the specified depth. |
|
getChildrenEl() : HTMLElement |
Node |
Returns the div that was generated for this node's children |
|
getChildrenElId() : string |
Node |
Returns the id for this node's children div |
|
getDepthStyle(int depth ) : string |
Node |
Returns the css class for the spacer at the specified depth for
this node. If this node's ancestor at the specified ... |
|
getEl() : HTMLElement |
Node |
Returns this node's container html element |
|
getElId() : string |
Node |
Returns the id for this node's container div |
|
getHoverStyle() : string |
Node |
Returns the hover style for the icon |
|
getHtml() : string |
Node |
Returns the markup for this node and its children. |
|
getIconMode() : int |
Node |
Returns the current icon mode. This refers to the way childless dynamic
load nodes appear. |
|
getNodeHtml() : string |
Node |
Get the markup for the node. This is designed to be overrided so that we can
support different types of nodes. |
|
getSiblings() : Node[] |
Node |
Returns a node array of this node's siblings, null if none. |
|
getStyle() : string |
Node |
Returns the css style name for the toggle |
|
getToggleEl() : HTMLElement |
Node |
Returns the element that is being used for this node's toggle. |
|
getToggleElId() : string |
Node |
Returns the id for this node's toggle element |
|
getToggleLink() : string |
Node |
Generates the link that will invoke this node's toggle method |
|
hasChildren(checkForLazyLoad {boolean} ) : boolean |
Node |
Checks if this node has children. If this node is lazy-loading and the
children have not been rendered, we do not kn... |
|
hideChildren() : void |
Node |
Hides this node's children |
|
init(oData {object} , oParent {Node} , expanded {boolean} ) : void |
Node |
Initializes this node, gets some of the properties from the parent |
|
insertAfter(node {Node} ) : Node |
Node |
Inserts this node after the supplied node |
|
insertBefore(node {Node} ) : Node |
Node |
Inserts this node before this supplied node |
|
isDynamic() : boolean |
Node |
Evaluates if this node's children should be loaded dynamically. Looks for
the property both in this instance and the... |
|
isRoot() : boolean |
Node |
Evaluates if this node is the root node of the tree |
|
loadComplete() : void |
Node |
Load complete is the callback function we pass to the data provider
in dynamic load situations. |
|
refresh() : void |
Node |
Regenerates the html for this node and its children. To be used when the
node is expanded and new children have been... |
|
setDynamicLoad(fmDataLoader {function} , iconMode {int} ) : void |
Node |
Configures this node for dynamically obtaining the child data
when the node is first expanded. Calling it without th... |
|
showChildren() : void |
Node |
Shows this node's children |
|
toString() : string |
Node |
Node toString |
|
toggle() : void |
Node |
Expands if node is collapsed, collapses otherwise. |
children
public Node[] children
This node's child node collection.
This property is defined by Node.
childrenRendered
public boolean childrenRendered
This flag is set to true when the html is generated for this node's
children, and set to false when new children are added.
This property is defined by Node.
data
public object data
The data linked to this node. This can be any object or primitive
value, and the data can be used in getNodeHtml().
This property is defined by Node.
dataLoader
public function dataLoader
Function to execute when we need to get this node's child data.
This property is defined by Node.
depth
public int depth
The depth of this node. We start at -1 for the root node.
This property is defined by Node.
dynamicLoadComplete
public boolean dynamicLoadComplete
Dynamically loaded nodes only fetch the data the first time they are
expanded. This flag is set to true once the data has been fetched.
This property is defined by Node.
expanded
public boolean expanded
The node's expanded/collapsed state
This property is defined by Node.
hasIcon
public boolean hasIcon
The toggle/branch icon will not show if this is set to false. This
could be useful if the implementer wants to have the child contain
extra info about the parent, rather than an actual node.
This property is defined by Node.
href
public string href
The href for the node's label. If one is not specified, the href will
be set so that it toggles the node.
This property is defined by Node.
iconMode
public int iconMode
Used to configure what happens when a dynamic load node is expanded
and we discover that it does not have children. By default, it is
treated as if it still could have children (plus/minus icon). Set
iconMode to have it display like a leaf node instead.
This property is defined by Node.
index
public int index
The index for this instance obtained from global counter in YAHOO.widget.TreeView.
This property is defined by Node.
isLoading
public boolean isLoading
This is true for dynamically loading nodes while waiting for the
callback to return.
This property is defined by Node.
multiExpand
public boolean multiExpand
Can multiple children be expanded at once?
This property is defined by Node.
nextSibling
public Node nextSibling
This node's next sibling
This property is defined by Node.
parent
public Node parent
Parent node
This property is defined by Node.
previousSibling
public Node previousSibling
This node's previous sibling
This property is defined by Node.
renderHidden
public boolean renderHidden
Should we render children for a collapsed node? It is possible that the
implementer will want to render the hidden data... @todo verify that we
need this, and implement it if we do.
This property is defined by Node.
target
public string target
The label href target, defaults to current window
This property is defined by Node.
tree
public TreeView tree
Tree instance this node is part of
This property is defined by Node.
appendTo
public function appendTo(parentNode {Node}
)
Appends this node to the supplied node's child collection
Parameters:
{Node}
: parentNodethe node to append to.
Returns:
This method is defined by Node.
applyParent
public function applyParent(Node parentNode
)
Certain properties for the node cannot be set until the parent
is known. This is called after the node is inserted into a tree.
the parent is also applied to this node's children in order to
make it possible to move a branch from one tree to another.
Parameters:
parentNode
: Nodethis node's parent node
Returns:
This method is defined by Node.
collapse
public function collapse()
Hides this nodes children (creating them if necessary), changes the
toggle style.
This method is defined by Node.
collapseAll
public function collapseAll()
Recursively collapses all of this node's children.
This method is defined by Node.
completeRender
public function completeRender()
Called when we know we have all the child data.
This method is defined by Node.
expand
public function expand()
Shows this nodes children (creating them if necessary), changes the
toggle style, and collapses its siblings if multiExpand is not set.
This method is defined by Node.
expandAll
public function expandAll()
Recursively expands all of this node's children.
This method is defined by Node.
getAncestor
public function getAncestor(int depth
)
Returns this node's ancestor at the specified depth.
This method is defined by Node.
getChildrenEl
public function getChildrenEl()
Returns the div that was generated for this node's children
Parameters:
Returns:
HTMLElement
this node's children div
This method is defined by Node.
getChildrenElId
public function getChildrenElId()
Returns the id for this node's children div
This method is defined by Node.
getDepthStyle
public function getDepthStyle(int depth
)
Returns the css class for the spacer at the specified depth for
this node. If this node's ancestor at the specified depth
has a next sibling the presentation is different than if it
does not have a next sibling
This method is defined by Node.
getEl
public function getEl()
Returns this node's container html element
This method is defined by Node.
getElId
public function getElId()
Returns the id for this node's container div
This method is defined by Node.
getHoverStyle
public function getHoverStyle()
Returns the hover style for the icon
This method is defined by Node.
getHtml
public function getHtml()
Returns the markup for this node and its children.
This method is defined by Node.
getIconMode
public function getIconMode()
Returns the current icon mode. This refers to the way childless dynamic
load nodes appear.
This method is defined by Node.
getNodeHtml
public function getNodeHtml()
Get the markup for the node. This is designed to be overrided so that we can
support different types of nodes.
This method is defined by Node.
getSiblings
public function getSiblings()
Returns a node array of this node's siblings, null if none.
This method is defined by Node.
getStyle
public function getStyle()
Returns the css style name for the toggle
This method is defined by Node.
getToggleEl
public function getToggleEl()
Returns the element that is being used for this node's toggle.
This method is defined by Node.
getToggleElId
public function getToggleElId()
Returns the id for this node's toggle element
Parameters:
Returns:
string
the toggel element id
This method is defined by Node.
getToggleLink
public function getToggleLink()
Generates the link that will invoke this node's toggle method
This method is defined by Node.
hasChildren
public function hasChildren(checkForLazyLoad {boolean}
)
Checks if this node has children. If this node is lazy-loading and the
children have not been rendered, we do not know whether or not there
are actual children. In most cases, we need to assume that there are
children (for instance, the toggle needs to show the expandable
presentation state). In other times we want to know if there are rendered
children. For the latter, "checkForLazyLoad" should be false.
This method is defined by Node.
hideChildren
public function hideChildren()
Hides this node's children
This method is defined by Node.
init
public function init(oData {object}
, oParent {Node}
, expanded {boolean}
)
Initializes this node, gets some of the properties from the parent
This method is defined by Node.
insertAfter
public function insertAfter(node {Node}
)
Inserts this node after the supplied node
Parameters:
{Node}
: nodethe node to insert after
Returns:
This method is defined by Node.
insertBefore
public function insertBefore(node {Node}
)
Inserts this node before this supplied node
This method is defined by Node.
isDynamic
public function isDynamic()
Evaluates if this node's children should be loaded dynamically. Looks for
the property both in this instance and the root node. If the tree is
defined to load all children dynamically, the data callback function is
defined in the root node
This method is defined by Node.
isRoot
public function isRoot()
Evaluates if this node is the root node of the tree
This method is defined by Node.
loadComplete
public function loadComplete()
Load complete is the callback function we pass to the data provider
in dynamic load situations.
This method is defined by Node.
refresh
public function refresh()
Regenerates the html for this node and its children. To be used when the
node is expanded and new children have been added.
This method is defined by Node.
setDynamicLoad
public function setDynamicLoad(fmDataLoader {function}
, iconMode {int}
)
Configures this node for dynamically obtaining the child data
when the node is first expanded. Calling it without the callback
will turn off dynamic load for the node.
Parameters:
{function}
: fmDataLoaderthe function that will be used to get the data.
{int}
: iconModeconfigures the icon that is displayed when a dynamic load node is expanded the first time without children. By default, the "collapse" icon will be used. If set to 1, the leaf node icon will be displayed.
Returns:
This method is defined by Node.
showChildren
public function showChildren()
Shows this node's children
This method is defined by Node.
toString
public function toString()
This method is defined by Node.
toggle
public function toggle()
Expands if node is collapsed, collapses otherwise.
This method is defined by Node.