Class WFYAHOO_widget_TreeViewNode

Description

Helper object for WFYAHOO_widget_TreeView.

WFYAHOO_widget_TreeViewNode is a minimal PHP representation of the YAHOO.widget.node javascript object.

It contains the "id" and the "data" to be displayed in the tree, as well as helper functions for building and accessing the tree.

Located in /framework/widgets/yahoo/WFYAHOO_widget_TreeView.php (line 361)

WFObject
   |
   --WFYAHOO_widget_TreeViewNode
Variable Summary
array $children
string $data
string $id
Method Summary
WFYAHOO_widget_TreeViewNode __construct (string $id, [string $data = NULL])
array children ()
boolean couldHaveChildren ()
string data ()
boolean hasChildren ()
string id ()
void setCouldHaveChildren (boolean $could)
string toXML ()
Variables
array $children (line 374)
  • var: An array of child WFYAHOO_widget_TreeViewNode objects for this node.
  • access: protected
boolean $couldHaveChildren (line 378)
  • var: TRUE if the node does/could have children. If true, the node will be "expandable". FALSE if the node definitely doesn't have kids; it will be a leaf node.
  • access: protected
string $data (line 370)
  • var: The raw HTML code to be shown as the item at that level of the tree.
  • access: protected
string $id (line 366)
  • var: The ID of the node. ID's must be unique among children of the same node.
  • access: protected
Methods
Constructor __construct (line 386)

To create a node, the ID and DATA are required.

WFYAHOO_widget_TreeViewNode __construct (string $id, [string $data = NULL])
  • string $id: id
  • string $data: data

Redefinition of:
WFObject::__construct()
addChild (line 431)

Add a child node.

  • throws: object Exception If the node does not have a unique ID or isn't a WFYAHOO_widget_TreeViewNode object.
children (line 453)

Get the children of this node as an array.

  • return: An array of WFYAHOO_widget_TreeViewNode objects.
array children ()
childWithId (line 465)

Get the child node for the specified ID.

  • return: The node with the given id.
  • throws: object Exception if there is no node with that id.
object WFYAHOO_widget_TreeViewNode childWithId (string $i)
  • string $i: The ID of the desired child.
couldHaveChildren (line 420)

Is it possible that this node has children?

boolean couldHaveChildren ()
data (line 486)

Get the node data (the HTML).

  • return: The node data / html.
string data ()
hasChildren (line 443)

Does this node have children?

boolean hasChildren ()
id (line 476)

Get the ID for the node.

  • return: The ID.
string id ()
setCouldHaveChildren (line 409)

By default, it is assumed that all nodes *could* have children, and that a dynamic callback must be made to see.

Thus, all nodes will be "+" expandable icons. If you know for sure that a given node doesn't have children, setCouldHaveChildren(true) to have the node be a leaf node by default.

void setCouldHaveChildren (boolean $could)
  • boolean $could: TRUE if the node does/could have children. If true, the node will be "expandable". FALSE if the node definitely doesn't have kids; it will be a leaf node.
toXML (line 498)

Convert this node into XML format.

Helper function used by sendTree.

  • return: The XML representation of the node.
string toXML ()

Inherited Methods

Inherited From WFObject

WFObject::__construct()
WFObject::exposedProperties()
WFObject::getClass()
WFObject::keyPathToTargetAndKey()
WFObject::setValueForKey()
WFObject::setValueForKeyPath()
WFObject::validateValueForKey()
WFObject::validateValueForKeyPath()
WFObject::valueForKey()
WFObject::valueForKeyPath()
WFObject::valueForUndefinedKey()
WFObject::__toString()

Documentation generated on Sun, 28 Sep 2008 18:26:09 -0400 by phpDocumentor 1.4.1