User Guide

Table Of Contents
Building tree controls with the cftree tag 639
queryasroot="Department">
img="folder,document">
</cftree>
<br>
<cfinput type="submit" value="Submit">
</cfform>
Creating a multilevel tree control
The following figure shows an example of a multilevel tree control:
When populating a
cftree control, you create the multilevel structure of the tree by specifying a
parent for each item in the tree. The
parent attribute of the cftreeitem tag allows your cftree
tag to show relationships between elements in the tree.
In this example, every
cftreeitem tag, except the top level Divisions, specifies a parent. For
example, the
cftreeitem value="Development" tag specifies Divisions as its parent.
The following code populates the tree directly, not from a query:
<cfform name="form2" action="cfform_submit.cfm">
<cftree name="tree1" hscroll="No" vscroll="No"
border="No">
<cftreeitem value="Divisions">
<cftreeitem value="Development"
parent="Divisions" img="folder">
<cftreeitem value="Product One"
parent="Development" img="document">
<cftreeitem value="Product Two"
parent="Development">
<cftreeitem value="GUI"
parent="Product Two" img="document">
<cftreeitem value="Kernel"
parent="Product Two" img="document">
<cftreeitem value="Product Three"
parent="Development" img="document">
<cftreeitem value="QA"
parent="Divisions" img="folder">
<cftreeitem value="Product One"
parent="QA" img="document">
<cftreeitem value="Product Two"