Chapter 1: ColdFusion Tags
79
If the APPENDKEY attribute is set to No, then no grid values are appended to the URL.
The value of selection is determined by the value of the SELECTMODE attribute:
•
When SELECTMODE="Single", selection is the value of the column clicked.
•
When SELECTMODE="Row", selection is a comma-separated list of column
values in the clicked row, beginning with the value of the first cell in the selected
row.
When SELECTMODE="Column", selection is a comma-separated list of row values in
the clicked column, beginning with the value of the first cell in the selected column.
Note
CFGRID incorporates a Java applet, so browsers must be Java-enabled for
CFGRID to work properly.
Example
<!--- This example shows the CFGRID, CFGRIDCOLUMN, CFGRIDROW,
and CFGRIDUPDATE tags in action --->
<!--- use a query to show the useful qualities of CFGRID --->
<!--- If the gridEntered form field has been tripped,
perform the gridupdate on the table specified in the database.
Using the default value keyonly=yes allows us to change only
the information that differs from the previous grid --->
<CFIF IsDefined("form.gridEntered") is True>
<CFGRIDUPDATE GRID="FirstGrid" DATASOURCE="cfsnippets"
TABLENAME="CourseList" KEYONLY="Yes">
</CFIF>
<!--- query the database to fill up the grid --->
<CFQUERY NAME="GetCourses" DATASOURCE="cfsnippets">
SELECT Course_ID, Dept_ID, CorNumber,
CorName, CorLevel, CorDesc
FROM CourseList
ORDER by Dept_ID ASC, CorNumber ASC
</CFQUERY>
<HTML>
<HEAD>
<TITLE>
CFGRID Example
</TITLE>
</HEAD>
<BODY>
<H3>CFGRID Example</H3>
<I>Try adding a course to the database, and then deleting it.</I>
<!--- call the CFFORM to allow us to use CFGRID controls --->
<CFFORM ACTION="cfgrid.cfm" METHOD="POST" ENABLECAB="Yes">
<!--- We include Course_ID in the CFGRID, but do not allow
for its selection or display --->
Summary of Contents for COLDFUSION 4.5-CFML LANGUAGE
Page 1: ...Allaire Corporation CFML Language Reference ColdFusion 4 5...
Page 207: ...Chapter 1 ColdFusion Tags 183 CFCATCH CFTRY BODY HTML...
Page 224: ...200 CFMLLanguageReference CFOUTPUT P Text within CFOUTPUT is always shown CFOUTPUT BODY HTML...
Page 336: ...312 CFMLLanguageReference CFIF BODY HTML...
Page 404: ...380 CFMLLanguageReference DE It is morning CFOUTPUT P BODY HTML...
Page 413: ...Chapter 2 ColdFusion Functions 389 Customer BalanceDue BR CFOUTPUT CFIF BODY HTML...
Page 483: ...Chapter 2 ColdFusion Functions 459 CFOUTPUT CFLOOP BODY HTML...
Page 584: ...560 CFMLLanguageReference...
Page 594: ...570 CFMLLanguageReference...