Grouping Output From A Query - MACROMEDIA COLDFUSION 5-DEVELOPING Develop Manual

Table of Contents

Advertisement

148

Grouping output from a query

In a query that you display using a
employees by the department. In this case, you separate column names with
commas in the
To organize the tree based on ordered results of a query:
1
2
3
cftreeitem value
Open a new file named
Modify the page so that it appears as follows:
<!--- CFQUERY with an ORDER BY clause --->
<cfquery name="deptquery" datasource="CompanyInfo">
SELECT Dept_ID, FirstName + ' ' + LastName
AS FullName
FROM Employee
ORDER BY Dept_ID
</cfquery>
<!--- Build the tree control --->
<cfform name="form1" action="submit.cfm"
method="Post">
<cftree name="tree1"
hscroll="No"
border="Yes"
height="350"
required="Yes">
<cftreeitem value="Dept_ID, FullName"
query="deptquery"
queryasroot="Dept_ID"
img="cd,folder">
</cftree>
<br>
<br><input type="Submit" value="Submit">
</cfform>
Save the page and view it in your browser.
control, you might want to organize your
cftree
attribute.
in ColdFusion Studio.
tree2.cfm
Chapter 9 Building Dynamic Forms

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 5

Table of Contents