![]() ![]() ![]() |
Used inside CFFORM, CFGRID allows you to place a grid control in a ColdFusion form. A grid control is a table of data divided into rows and columns. CFGRID column data is specified with individual CFGRIDCOLUMN tags.
See also CFGRIDROW and CFGRIDUPDATE tags.
<CFGRID NAME="name" HEIGHT="integer" WIDTH="integer" VSPACE="integer" HSPACE="integer" ALIGN="value" QUERY="query_name" INSERT="Yes/No" DELETE="Yes/No" SORT="Yes/No" FONT="column_font" FONTSIZE="size" ITALIC="Yes/No" BOLD="Yes/No" HREF="URL" HREFKEY="column_name" TARGET="URL_target" APPENDKEY="Yes/No" HIGHLIGHTHREF="Yes/No" ONVALIDATE="javascript_function" ONERROR="text" GRIDDATAALIGN="position" GRIDLINES="Yes/No" ROWHEIGHT="pixels" ROWHEADERS="Yes/No" ROWHEADERALIGN="position" ROWHEADERFONT="font_name" ROWHEADERFONTSIZE="size" ROWHEADERITALIC="Yes/No" ROWHEADERBOLD="Yes/No" ROWHEADERWIDTH="col_width" COLHEADERS="Yes/No" COLHEADERALIGN="position" COLHEADERFONT="font_name" COLHEADERFONTSIZE="size" COLHEADERITALIC="Yes/No" COLHEADERBOLD="Yes/No" BGCOLOR="color" SELECTCOLOR="color" SELECTMODE="mode" MAXROWS="number" NOTSUPPORTED="text" PICTUREBAR="Yes/No" INSERTBUTTON="text" DELETEBUTTON="text" SORTASCENDINGBUTTON="text" SORTDESCENDINGBUTTON="text"> </CFGRID>
Required. A name for the grid element.
Optional. Height value of the grid control in pixels.
Optional. Width value of the grid control in pixels.
Optional. Vertical margin spacing above and below the grid control in pixels.
Optional. Horizontal margin spacing to the left and right of the grid control in pixels.
Optional. Alignment value. Valid entries are: Top, Left, Bottom, Baseline, Texttop, Absbottom, Middle, Absmiddle, Right.
Optional. The name of the query associated with the grid control.
Optional. Yes or No. Yes allows end users to insert new row data into the grid. Default is No.
Optional. Yes or No. Yes allows end users to delete row data in the grid. Default is No.
Optional. Yes or No. When Yes sort buttons are added to the grid control. When clicked the sort buttons perform a simple text sort on the selected column. Default is No.
Optional. Font name to use for all column data in the grid control.
Optional. Font size for text in the grid control, measured in points.
Optional. Yes or No. Yes presents all grid control text in italic. Default is No.
Optional. Yes or No. Yes presents all grid control text in boldface. Default is No.
Optional. URL to associate with the grid item or a query column for a grid that is populated from a query. If HREF is a query column, then the HREF value that is displayed is populated by the query. If HREF is not recognized as a query column, it is assumed that the HREF text is an actual HTML HREF.
Optional. The name of a valid query column when the grid uses a query. The column specified becomes the Key no matter what the select mode is for the grid.
Optional. Target attribute for HREF URL.
Optional. Yes or No. When used with HREF, Yes passes the CFGRIDKEY variable along with the value of the selected tree item in the URL to the application page specified in the CFFORM ACTION attribute. Default is Yes.
Optional. Yes highlights links associated with a CFGRID with an HREF attribute value. No disables highlight. Default is Yes.
Optional. The name of a valid JavaScript function used to validate user input. The form object, input object, and input object value are passed to the specified routine, which should return True if validation succeeds and False otherwise.
Optional. The name of a valid JavaScript function you want to execute in the event of a failed validation.
Optional. Enter Left, Right, or Center to position data in the grid within a column. Default is Left.
Optional. Yes or No. Yes enables rules (lines) in the grid control, No suppresses row and column rules. Default is Yes.
Optional. Enter a numeric value for the number of pixels to determine the minimum row height for the grid control. Used with CFGRIDCOLUMN TYPE="Image", you can use ROWHEIGHT to define enough room for graphics you want to display in the row.
Optional. Yes or No. Yes displays row labels in the grid control. Defaults to Yes.
Optional. Enter Left, Right, or Center to position data within a row header. Default is Left.
Optional. Font to use for the row label.
Optional. Size font for row label text in the grid control, measured in points.
Optional. Yes or No. Yes presents row label text in italic. Default is No.
Optional. Yes or No. Yes presents row label text in boldface. Default is No.
Optional. The width, in pixels, of the row header column.
Optional. Yes or No. Yes displays column headers in the grid control. Defaults to Yes.
Optional. Enter Left, Right, or Center to position data within a column header. Default is Left.
Optional. Font to use for the column header in the grid control.
Optional. Size font for column header text in the grid control, measured in points.
Optional. Yes or No. Yes presents column header text in italic. Default is No.
Optional. Yes or No. Yes presents column header text in boldface. Default is No.
Optional. Background color value for the grid control. Valid entries are: black, magenta, cyan, orange, darkgray, pink, gray, white, lightgray, yellow.
A hex value can be entered in the form:
BGCOLOR="##xxxxxx"
where x is 0-9 or A-F. Use either two pound signs or no pound signs.
Optional. Background color for a selected item. See BGCOLOR for color options.
Optional. Selection mode for items in the grid control. Valid entries are:
Default is Browse.
Optional. Specifies the maximum number of rows you want to display in the grid.
Optional. The text you want to display if the page containing a Java applet-based CFFORM control is opened by a browser that does not support Java or has Java support disabled. For example:
NOTSUPPORTED="<B> Browser must support Java to view ColdFusion Java Applets</B>"
By default, if no message is specified, the following message appears:
<B>Browser must support Java to <BR> view ColdFusion Java Applets!</B>
Optional. Yes or No. When Yes, image buttons are used for the Insert, Delete, and Sort actions rather than text buttons. Default is No.
Optional. Text to use for the Insert action button. The default is Insert.
Optional. Text to use for the Delete action button. The default is Delete.
Optional. The text to use for the Sort button. The default is "A -> Z
".
Optional. The text to use for the Sort button. The default is "Z <- A
".
You can populate a CFGRID with data from a CFQUERY. If you do not specify any CFGRIDCOLUMN entries, a default set of columns is generated. Each column in the query is included in the default column list. In addition, a default header for each column is created by replacing any hyphen (-) or underscore (_) characters in the table column name with spaces. The first character and any character after a space is changed to uppercase; all other characters are lowercase.
![]() ![]() ![]() |
AllaireDoc@allaire.com
Copyright © 1998, Allaire Corporation. All rights reserved.