Chapter 10: Building Dynamic Forms
139
HEADERITALIC="NO"
HEADERBOLD="YES"
DISPLAY="YES"
SELECT="YES">
<CFGRIDCOLUMN NAME="Department_ID"
HEADER="Department"
WIDTH=240
ITALIC="No"
HEADERALIGN="center"
HEADERITALIC="No"
HEADERBOLD="Yes"
BOLD="Yes"
DISPLAY="Yes">
</CFGRID>
<INPUT TYPE="Submit" VALUE="Submit">
</CFFORM>
3.
Save the file as
grid2.cfm
.
To update the data source with CFQUERY:
1.
Open a new file in Studio.
2.
Modify the file so that it appears as follows:
<HTML>
<HEAD>
<TITLE>Catch submitted grid values</TITLE>
</HEAD>
<BODY>
<H3>Grid values for FORM.employee_grid row updates</H3>
<CFIF IsDefined("form.employee_grid.rowstatus.action")>
<CFLOOP INDEX = "Counter" FROM = "1" TO =
#ArrayLen(form.employee_grid.rowstatus.action)#>
<CFOUTPUT>
The row action for #Counter# is:
#form.employee_grid.rowstatus.action[Counter]#
<BR><BR>
</CFOUTPUT>
<CFIF form.employee_grid.rowstatus.action[Counter] IS "D">
<CFQUERY NAME="DeleteExistingEmployee"
DATASOURCE="CompanyInfo">
DELETE FROM Employees
WHERE
Employee_ID=#form.employee_grid.original.Employee_ID[Counter]#
Summary of Contents for COLDFUSION 4.5-DEVELOPING WEB
Page 1: ...Allaire Corporation Developing Web Applications with ColdFusion ColdFusion 4 5...
Page 14: ...xiv Developing Web Applications with ColdFusion...
Page 26: ...xxvi Developing Web Applications with ColdFusion...
Page 34: ...8 Developing Web Applications with ColdFusion...
Page 70: ...44 Developing Web Applications with ColdFusion...
Page 84: ...58 Developing Web Applications with ColdFusion...
Page 114: ...88 Developing Web Applications with ColdFusion...
Page 148: ...122 Developing Web Applications with ColdFusion...
Page 174: ...148 Developing Web Applications with ColdFusion...
Page 208: ...182 Developing Web Applications with ColdFusion...
Page 244: ...218 Developing Web Applications with ColdFusion...
Page 274: ...248 Developing Web Applications with ColdFusion...
Page 288: ...262 Developing Web Applications with ColdFusion...
Page 300: ...274 Developing Web Applications with ColdFusion...
Page 350: ...324 Developing Web Applications with ColdFusion...
Page 362: ...336 Developing Web Applications with ColdFusion...