User Guide

Table Of Contents
Building tree controls with the cftree tag 637
2.
Save the page and view it in your browser. It should look as follows
Reviewing the code
The following table describes the highlighted code and its function
:
The cftreeitem comma-separated value, img, and imgopen attributes correspond to the tree
level structure. In applet format, if you omit the
img attribute, ColdFusion uses the folder image
for all levels in the tree; if you omit the
imgopen attribute, ColdFusion uses the folder image for
all expanded levels in the tree. Flash format ignores the
img and imgopen attributes and always
uses folders for levels with children and documents for nodes without children.
Code Description
ORDER BY Dept_ID
Orders the query results by department.
<cftreeitem
value="Dept_ID,FullName"
Populates the tree with the department ID, and under each
department, the full name for each employee in the
department.
queryasroot="Dept_ID"
Labels the root "Dept_ID".
img="computer,folder,document"
imgopen="computer,folder"
Uses the ColdFusion supplied computer image for the root
level, folder image for the department IDs, and document
for the names, independent of whether any level is
expanded (open) or collapsed. The
imgopen attribute has
only two items, because the employee names can never be
open.