Editing Data In A Cfgrid - MACROMEDIA COLDFUSION 4.5-DEVELOPING WEB Develop Manual

Developing web applications with coldfusion
Table of Contents

Advertisement

138

Editing data in a CFGRID

To enable grid editing, you use the SELECTMODE="EDIT" attribute. When enabled, a
user can edit cell data and insert or delete grid rows. When a CFFORM containing a
CFGRID is submitted, data about changes to grid cells are stored in one-dimensional
arrays you can reference like any other ColdFusion array.
To make the grid editable:
1.
Open the file
2.
Edit the file so that it appears as follows:
<CFQUERY NAME="empdata" DATASOURCE="CompanyInfo">
</CFQUERY>
<CFFORM NAME="GridForm"
in Studio.
grid1.cfm
SELECT * FROM Employees
ACTION="handle_grid.cfm">
<CFGRID NAME="employee_grid"
HEIGHT=170
WIDTH=400
HSPACE=10
VSPACE=6
ALIGN="LEFT"
SELECTCOLOR="white"
SELECTMODE="edit"
ROWHEADERS="YES"
ROWHEADERWIDTH=25
ROWHEADERALIGN="right"
COLHEADERS="YES"
QUERY="empdata"
GRIDDATAALIGN="left"
BGCOLOR="yellow"
INSERT="YES"
DELETE="YES"
SORT="YES"
MAXROWS=60>
<CFGRIDCOLUMN NAME="Employee_ID"
HEADER="Employee ID"
WIDTH=80
ITALIC="NO"
HEADERALIGN="center"
HEADERITALIC="NO"
HEADERBOLD="YES"
DISPLAY="NO">
<CFGRIDCOLUMN NAME="LastName"
HEADER="Last Name"
WIDTH=80
ITALIC="NO"
HEADERALIGN="center"
Developing Web Applications with ColdFusion

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 4.5

Table of Contents