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 457)

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 470)
  • var: An array of child WFYAHOO_widget_TreeViewNode objects for this node.
  • access: protected
boolean $couldHaveChildren (line 474)
  • 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 466)
  • var: The raw HTML code to be shown as the item at that level of the tree.
  • access: protected
string $id (line 462)
  • var: The ID of the node. ID's must be unique among children of the same node.
  • access: protected
Methods
Constructor __construct (line 482)

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 527)

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 549)

Get the children of this node as an array.

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

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 516)

Is it possible that this node has children?

boolean couldHaveChildren ()
data (line 582)

Get the node data (the HTML).

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

Does this node have children?

boolean hasChildren ()
id (line 572)

Get the ID for the node.

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

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 594)

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::setValuesForKeys()
WFObject::validatedSetValueForKey()
WFObject::validatedSetValueForKeyPath()
WFObject::validateObject()
WFObject::validateValueForKey()
WFObject::validateValueForKeyPath()
WFObject::valueForKey()
WFObject::valueForKeyPath()
WFObject::valueForStaticKey()
WFObject::valueForStaticKeyPath()
WFObject::valueForTargetAndKeyPath()
WFObject::valueForUndefinedKey()
WFObject::valueForUndefinedStaticKey()
WFObject::valuesForKeyPaths()
WFObject::valuesForKeys()
WFObject::_valueForStaticKey()
WFObject::__toString()

Documentation generated on Thu, 14 May 2009 16:20:57 -0400 by phpDocumentor 1.4.2