3-1-Tags:CFGrid
last edited by
lmajano
on 23-Aug-2009
cfgrid
Description
Used inside cfform, cfgrid lets you place a grid control in a ColdFusion form. A grid control is a table of data divided into rows and columns. The cfgrid tag column data is specified with cfgridcolumn tags.
Category
Other
Implemented
Usage Syntax
<cfgrid name="String" [format="String"] [height="number"] [width="number"] [autoWidth="Boolean"] [vSpace="number"] [hSpace="number"] [align="String"] [query="String"] [insert="Boolean"] [delete="Boolean"] [sort="Boolean"] [font="String"] [fontSize="number"] [italic="Boolean"] [bold="Boolean"] [textColor="String"] [href="String"] [hrefKey="String"] [target="String"] [appendKey="Boolean"] [highlightHref="Boolean"] [onValidate="String"] [onError="String"] [gridDataAlign="String"] [gridLines="Boolean"] [rowHeight="number"] [rowHeaders="Boolean"] [rowHeaderAlign="String"] [rowHeaderFont="String"] [rowHeaderFontSize="number"] [rowHeaderItalic="Boolean"] [rowHeaderBold="Boolean"] [rowHeaderTextColor="String"] [rowHeaderWidth="number"] [colHeaders="Boolean"] [colHeaderAlign="String"] [colHeaderFont="String"] [colHeaderFontSize="number"] [colHeaderItalic="Boolean"] [colHeaderBold="Boolean"] [colHeaderTextColor="String"] [bgColor="String"] [selectColor="String"] [selectMode="String"] [maxRows="String"] [notSupported="String"] [pictureBar="Boolean"] [insertButton="String"] [deleteButton="String"] [sortAscendingButton="String"] [sortDescendingButton="String"] [enabled="Boolean"] [onChange="String"] [style="String"] [tooltip="String"] [visible="Boolean"] [onBlur="String"] [onFocus="String"] />
[] = Optional attribute
Attributes
| Name | Type | Required | Default | Description |
| name | String | Yes | A name for the grid element. | |
| format | String | No | Height value of the grid control, in pixels. | |
| height | number | No | Height value of the grid control, in pixels. | |
| width | number | No | Width value of the grid control, in pixels. | |
| autoWidth | Boolean | No | Optional. Yes or No. Default is No. If Yes, automatically sets the width of each column so that all the columns are visible within the grid's specified width. All columns are initially set to equal widths. Users can resize any column. No horizontal scroll bars are available since all columns are visible. note that if you explicitly specify the width of a column and set autoWidth to Yes, ColdFusion will set the column to the explicit width, if possible. | |
| vSpace | number | No | Vertical margin spacing above and below the grid control, in pixels. | |
| hSpace | number | No | Horizontal margin spacing to the left and right of the grid control, in pixels. | |
| align | String | No | Alignment value. Options are: Top, Left, Bottom, Baseline, Texttop, Absbottom, Middle, Absmiddle, Right. | |
| query | String | No | Name of the query associated with the grid control. | |
| insert | Boolean | No | Yes lets end users insert row data into the grid. Default is No. | |
| delete | Boolean | No | Yes lets end users delete row data from the grid. Default is No. | |
| sort | Boolean | No | If Yes, sort buttons are added to the grid control. When clicked, sort buttons perform a simple text sort on the selected column. Default is No. Note that columns are sortable by clicking the column head, even if no sort button is displayed. | |
| font | String | No | Font to use for column data in the grid control. | |
| fontSize | number | No | Font size for text in the grid control, in points. | |
| italic | Boolean | No | Yes displays grid control text in italic. Default is No. | |
| bold | Boolean | No | Yes displays grid control text in boldface. Default is No. | |
| textColor | String | No | Color value for text in the grid control. Options are: black (default), magenta, cyan, orange, darkgray, pink, gray, white, lightgray, yellow. A hex value can be entered in the form: textColor = "##xxxxxx" where x is 0-9 or A-F. Use two pound signs or no pound signs. | |
| href | String | No | 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, the href value 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. | |
| hrefKey | String | No | The name of a query column when the grid uses a query. The column specified becomes the Key regardless of the select mode for the grid. | |
| target | String | No | Target attribute for href URL. | |
| appendKey | Boolean | No | When used with href, Yes passes query string value of the selected tree item in the URL to the application page specified in the cfform action attribute. Default is Yes. | |
| highlightHref | Boolean | No | Yes highlights links associated with a cfgrid with an href attribute value. No disables highlight. Default is Yes. | |
| onValidate | String | No | The name of a JavaScript function used to validate user input. The form object, input object, and input object value are passed to the routine, which should return True if validation succeeds and False otherwise. | |
| onError | String | No | The name of a JavaScript function to execute in the event of a failed validation. | |
| gridDataAlign | String | No | Enter Left, Right, or Center to position data in the grid within a column. Default is Left. | |
| gridLines | Boolean | No | Yes or No. Yes enables row and column rules (lines) in the grid control. No suppresses rules. Default is Yes. | |
| rowHeight | number | No | Number of pixels for the minimum row height of the grid control. Used with cfgridcolumn type = "Image", you can use rowHeight to define enough space for graphics to display in the row. | |
| rowHeaders | Boolean | No | Yes or No. Yes displays a column of numeric row labels in the grid control. Defaults to Yes. | |
| rowHeaderAlign | String | No | Enter Left, Right, or Center to position data within a row header. Default is Left. | |
| rowHeaderFont | String | No | Font to use for the row label. | |
| rowHeaderFontSize | number | No | Size for row label text in the grid control, in points. | |
| rowHeaderItalic | Boolean | No | Yes or No. Yes displays row label text in italic. Default is No. | |
| rowHeaderBold | Boolean | No | Yes or No. Yes displays row label text in boldface. Default is No. | |
| rowHeaderTextColor | String | No | Text color value for the grid control row headers. Entries are: black (default), magenta, cyan, orange, darkgray, pink, gray, white, lightgray, yellow. A hex value can be entered in the form: rowHeaderTextColor = "##xxxxxx" Where x is 0-9 or A-F. Use two pound signs or no pound signs. | |
| rowHeaderWidth | number | No | The width, in pixels, of the row header column. | |
| colHeaders | Boolean | No | Yes or No. Yes displays column headers in the grid control. Default is Yes. | |
| colHeaderAlign | String | No | Enter Left, Right, or Center to position data within a column header. Default is Left. | |
| colHeaderFont | String | No | Font for the column header in the grid control. | |
| colHeaderFontSize | number | No | Size for column header text in the grid control, in points. | |
| colHeaderItalic | Boolean | No | Yes or No. Yes displays column header text in italic. Default is No. | |
| colHeaderBold | Boolean | No | Yes or No. Yes displays column header text in boldface. Default is No. | |
| colHeaderTextColor | String | No | Color value for the grid control column headers. Valid entries are: black (default), magenta, cyan, orange, darkgray, pink, gray, white, lightgray, yellow.A hex value can be entered in the form: colHeaderTextColor = "##xxxxxx" where x is 0-9 or A-F. Use either two pound signs or no pound signs. | |
| bgColor | String | No | Background color value for the grid control. 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. | |
| selectColor | String | No | Background color for a selected item. See bgColor for color options. | |
| selectMode | String | No | Selection mode for items in the grid control. | |
| maxRows | String | No | Specifies the maximum number of rows to display in the grid. | |
| notSupported | String | No | Selection mode for items in the grid control. | |
| pictureBar | Boolean | No | Yes or No. If Yes, images are used for the Insert, delete, and Sort buttons rather than text. Default is No. | |
| insertButton | String | No | Text to use for the Insert action button. The default is Insert. | |
| deleteButton | String | No | Text to use for the delete action button. The default is delete. | |
| sortAscendingButton | String | No | Text to use for the Sort button. Default is "A - Z". | |
| sortDescendingButton | String | No | Text to use for the Sort button. Default is "Z - A". | |
| enabled | Boolean | No | ||
| onChange | String | No | ||
| style | String | No | ||
| tooltip | String | No | ||
| visible | Boolean | No | ||
| onBlur | String | No | ||
| onFocus | String | No |
Example Usage
You need to login in order to comment!
SideBar
User Login
Comments (