Creating An Editable Grid - MACROMEDIA COLDFUSION MX 61-DEVELOPING COLDFUSION MX Develop Manual

Developing coldfusion mx applications
Table of Contents

Advertisement

Creating an editable grid

You can build grids to allow users to edit data within them. Users can edit individual cell data, as
well as insert, update, or delete rows. To enable grid editing, you specify
the
tag.
cfgrid
To let users add or delete grid rows, you also have to set the
to Yes. Setting
cfgrid
buttons as part of the grid, as the following figure shows:
You can use a grid in two ways to make changes to your ColdFusion data sources:
Create a page to which you pass the
operations to update data source records based on the form values returned by
Pass grid edits to a page that includes the
form variable values and passes that data directly to the data source.
Using
gives you complete control over interactions with your data source. The
cfquery
tag provides a much simpler interface for operations that do not require the same
cfgridupdate
level of control.
Controlling cell contents
The
,
value
valuesDisplay,
control the data that a user can enter into a
By default, a cell is not editable. Use the
contents.
Use the
type
image.
Use the
values
You can use the
the actual values that you enter in the database. You can use the
specify the separator between values in the
While
cfgrid
lets you specify a JavaScript function to perform validation.
For more information on controlling the cell contents, see the attribute descriptions for
cfgridcolumn
or
insert
delete
and
valuesDelimiter
attribute to control sorting order, to make the fields check boxes, or to display an
attribute to specify a drop-down list of values from which the user can chose.
attribute to provide a list of items to display that differs from
valuesDisplay
does not have a
validate
in CFML Reference.
insert
to Yes causes the
cfgrid
form variables. In that page, perform
cfgrid
tag, which automatically extracts the
cfgridupdate
attributes of the
cell in the following ways:
cfgrid
attribute
cfgrid
selectmode="edit"
values valuesDisplay
attribute, it does have an
selectmode="edit"
or
attributes in
delete
tag to display insert and delete
cfquery
cfgrid
cfgridcolumn
to edit cell
valuesDelimiter
lists.
attribute that
onvalidate
Creating data grids with cfgrid
in
.
tag let you
attribute to
599

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion mx

Table of Contents