MACROMEDIA COLDFUSION 4.5-DEVELOPING WEB Develop Manual page 167

Developing web applications with coldfusion
Table of Contents

Advertisement

Chapter 10: Building Dynamic Forms
How user edits are stored
The following arrays are created to keep track of edits to grid rows and cells:
Arrays Used to Store Grid Cell Edit Information
Array reference
gridname . colname [ row_index ]
gridname. Original. colname [ row_index ]
gridname. RowStatus.Action [ row_index ]
For example, you have an updateable CFGRID called "mygrid" consisting of two
displayable columns, col1, col2, and one hidden column, col3. When an end user
selects and changes data in a row, arrays are created to store the original values for all
columns as well as the new column values for rows that have been updated, inserted,
or deleted.
mygrid.col1[ row_index ]
mygrid.col2[ row_index ]
mygrid.col3[ row_index ]
mygrid.original.col1[ row_index ]
mygrid.original.col2[ row_index ]
mygrid.original.col3[ row_index ]
Where row_index is the array index containing the grid data.
If the end user makes a change to a single cell in col2, you can reference the edit
operation, the original cell value, and the edited cell value in the following arrays:
<CFSET edittype = mygrid.RowStatus.Action[1]><BR>
<CFSET new_value = mygrid.col2[1]><BR>
<CFSET old_value = mygrid.original.col2[1]>
Multi-row edits
The use of arrays to track changes allows ColdFusion to manage changes to more than
one row in a CFGRID. ColdFusion coordinates entries in the arrays used to store edit
type (Update, Insert, or Delete), with arrays that store original grid data and edited grid
data. For each grid cell edit, an entry is created in the RowStatus array, and
corresponding entries are made in the arrays that store the new cell value and the
original cell value.
Description
Stores the new value of an edited
grid cell
Stores the original value of the
edited grid cell
Stores the edit type made against
the edited grid cell.
141

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the COLDFUSION 4.5-DEVELOPING WEB and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Coldfusion 4.5

Table of Contents