Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 731

Developing applications
Hide thumbs Also See for 38043740 - ColdFusion Standard - Mac:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Requesting and Presenting Information
Reviewing the code
The following table describes the highlighted code and its function:
Code
<cftree name="tree1"
required="Yes"
hscroll="No"
<cftreeitem value="FullName" query="engquery"
queryasroot="Yes"
img="folder,document"
Grouping output from a query
In a query that you display using a
with commas in the
cftreeitemvalue
Organize the tree based on ordered results of a query
Create a ColdFusion page named tree2.cfm with the following content:
1
<!--- CFQUERY with an ORDER BY clause. --->
<cfquery name="deptquery" datasource="cfdocexamples">
SELECT Dept_ID, FirstName || ' ' || LastName
AS FullName
FROM Employee
ORDER BY Dept_ID
</cfquery>
<!--- Build the tree control. --->
<cfform name="form1" action="submit.cfm">
<cftree name="tree1"
hscroll="No"
border="Yes"
height="350"
required="Yes">
<cftreeitem value="Dept_ID, FullName"
query="deptquery"
queryasroot="Dept_ID"
img="computer,folder,document"
imgopen="computer,folder"
expand="yes">
</cftree>
<br>
<br><input type="Submit" value="Submit">
</cfform>
Description
Creates a tree and names it tree1.
Specifies that a user must select an item in the tree.
Does not allow horizontal scrolling.
Creates an item in the tree and puts 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.
Specifies the query name as the root level of the tree control.
Uses the folder and document images that ship with ColdFusion in the tree
structure.
When populating a cftree tag with data from a cfquery tag, you can specify
images or filenames for each level of the tree as a comma-separated list.
control, to organize your employees by department, separate column names
cftree
attribute.
Last updated 1/20/2012
726

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents