An instance of TreeIterator class (or the sub-classes LazyTreeIterator (5.4.11.8) or EllipsisTreeIterator (5.4.11.9)) will be placed into the execution context using the name specified in the iter (5.4.11.3) attribute. This iterator will contain traversal data for the current node each time the tag content is executed.
Note that it is also acceptable to create an instance of one of the TreeIterator classes prior to rendering the template. The set_selected_aliases() or set_open_aliases() methods can then be used to render the tree with nodes already selected or open.
By using an object to iterate over the tree the toolkit is able to provide additional data that is useful in formatting HTML. The toolkit also places the iterator into the session (you must be using an application class that supports sessions).
) |
) |
) |
) |
n.tree_depth() - n.depth()
. It is intended to
be used for the colspan of the table cell containing the node
name when laying the tree out in a table. See the
samples/tree/tree2.html template for just such an example.
depth) |
A return value of 0
indicates no line, 1
indicates a
line that joins a node later than this node, and 2
indicates a
line that terminates at this node.
The example in section 3.12 uses this method.
) |
TRUE
if the current node is open. For non-lazy iterators,
this is always TRUE
except on leaf nodes.
) |
FALSE
.
) |
TRUE
if the current node has children (ie. it defines a
children member).
Most of the methods and all of the members are not meant to be accessed from your code but are documented below to help clarify how the iterator behaves.
line) |
node) |
ctx, node) |