Building Tree Controls With Cftree - MACROMEDIA COLDFUSION 5-DEVELOPING Develop Manual

Table of Contents

Advertisement

Building Tree Controls with cftree

Building Tree Controls with cftree

The
collapsible tree populated from data source queries. To build a tree control with
cftree
one of six built-in icons to represent individual items in the tree control, or supply a
URL to your own gif image.
To create and populate a tree control from a query:
1
2
3
Reviewing the code
The following table describes the highlight code and its function:
Code
<cftree name="tree1"
required="Yes"
hscroll="No"
<cftreeitem value=FullName
query="engquery"
queryasroot="Yes"
img="folder,document"
form lets you display hierarchical information in a space-saving
cftree
, you use individual
Open a new file named
Modify the page so that it appears as follows:
<cfquery name="engquery" datasource="CompanyInfo">
SELECT FirstName + ' ' + LastName AS FullName
FROM Employee
</cfquery>
<cfform name="form1" action="submit.cfm"
method="Post">
<cftree name="tree1"
required="Yes"
hscroll="No">
<cftreeitem value=fullname
query="engquery"
queryasroot="Yes"
img="folder,document">
</cftree>
</cfform>
Save the page and view it in your browser.
tags to populate the control. You can specify
cftreeitem
in ColdFusion Studio.
tree1.cfm
Description
Create a tree and name it tree1.
Specify that a user must select an item in the tree.
Don't allow horizontal scrolling.
Create an item in the tree and put the results of the
query named engquery in it. Because this tag uses
a query, it puts one item on the tree per query entry.
Specify the query name as the root level of the tree
control.
Use the images "folder" and "document" that ship
with ColdFusion in the tree structure.
147

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 5

Table of Contents