Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 738

Developing applications
Hide thumbs Also See for 38043740 - ColdFusion Standard - Mac:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Requesting and Presenting Information
Just as the
tag uses the
cftree
define a wide range of row and column formatting options, as well as a column name, data type, selection options, and
so on. You use the
cfgridcolumn
column.
Use the
tag to define a grid that does not use a query as the source for row data. If a query attribute is
cfgridrow
specified in the
tag, the
cfgrid
The
tag provides many attributes that control grid behavior and appearance. Only the most important of these
cfgrid
attributes are described here. For detailed information on these attributes, see the
Working with a data grid and entering data
The following image shows an example applet format grid created using a
The following table describes some navigating tips:
Action
Sorting grid rows
Rearranging columns
Determining editable grid areas
Determining noneditable grid areas
Editing a grid cell
Deleting a row
Inserting a row
Populate a grid from a query
Create a ColdFusion page named grid1.cfm with the following contents:
1
<cfquery name="empdata" datasource="cfdocexamples">
SELECT * FROM Employee
</cfquery>
<cfform name="Form1" action="submit.cfm" >
<cfgrid name="employee_grid" query="empdata"
selectmode="single">
<cfgridcolumn name="Emp_ID">
<cfgridcolumn name="LastName">
<cfgridcolumn name="Dept_ID">
</cfgrid>
<br>
<cfinput name="submitit" type="Submit" value="Submit">
</cfform>
Note: Use the
cfgridcolumndisplay="No"
expose to an end user. You typically use this attribute to include columns such as the table's primary key column in
the results returned by the
Save the file and view it in your browser.
2
tag, the
cftreeitem
cfgrid
tag to define individual columns in the grid or associate a query column with a grid
tags are ignored.
cfgridrow
Procedure
Double-click the column header to sort a column in ascending order. Double-click again to sort the
rows in descending order.
Click any column heading and drag the column to a new position.
When you click an editable cell, it is surrounded by a yellow box.
When you click a cell (or row or column) that you cannot edit, its background color changes. The
default color is salmon pink.
Double-click the cell. Press Return when you finish entering the data.
Click any cell in the row and click the Delete button. (Not available in Flash format grids.)
Click the Insert button. An empty row appears at the bottom of the grid. To enter a value in each cell,
double-click the cell, enter the value, and click Return. (Not available in Flash format grids.)
attribute to hide columns that you want to include in the grid but not
tag.
cfgrid
Last updated 1/20/2012
tag uses the
and
cfgridcolumn
cfgrid
tag.
cfgrid
tags. You can
cfgridrow
tag in the CFML Reference
.
733

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents