CFGRIDCOLUMN | |||||||||||||||||||||||||
Description | |||||||||||||||||||||||||
Used with the cfgrid tag in a cfform. Use this tag to specify column data in a cfgrid control. The font and alignment attributes used in cfgridcolumn override global font or alignment settings defined in cfgrid. | |||||||||||||||||||||||||
Category | |||||||||||||||||||||||||
Forms tags | |||||||||||||||||||||||||
Syntax<cfgridcolumn name = "column_name" header = "header" width = "column_width" font = "column_font" fontSize = "size" italic = "Yes" or "No" bold = "Yes" or "No" textColor = "web color" or "expression" bgColor = "web color" or "expression" href = "URL" hrefKey = "column_name" target = "URL_target" select = "Yes" or "No" display = "Yes" or "No" type = "type" headerFont = "font_name" headerFontSize = "size" headerItalic = "Yes" or "No" headerBold = "Yes" or "No" headerTextColor = "web color" dataAlign = "position" headerAlign = "position" numberFormat = "format" values = "Comma separated strings and/or numeric range" valuesDisplay = "Comma separated strings and/or numeric range" valuesDelimiter = "delimiter character"> |
|||||||||||||||||||||||||
See also | |||||||||||||||||||||||||
cfgrid, cfgridrow, cfgridupdate, cfapplet, cfform, cfinput, cfselect, cfslider, cftextinput, cftree | |||||||||||||||||||||||||
History | |||||||||||||||||||||||||
ColdFusion MX: Changed behavior if select = "no": a user cannot select and edit the cell data, regardless of the cfgrid selectmode attribute value. When clicked, the cell border (and, depending on the selectColor value, the cell background) changes color, but the cell data cannot be edited. | |||||||||||||||||||||||||
Using expressions in textColor and bgColor attributes | |||||||||||||||||||||||||
The textColor and bgColor attributes accept the following kinds of values:
|
|||||||||||||||||||||||||
The syntax for an expression is as follows:
(CX operator string ? true_condition : false_condition) |
|||||||||||||||||||||||||
The symbol meanings are as follows:
|
|||||||||||||||||||||||||
If the string in the expression can be interpreted as a number, the comparisons in the expression are interpreted as numeric. Otherwise, the comparison is a string comparison. | |||||||||||||||||||||||||
This code shows an expression that displays the grid element in blue if the grid element contains the string "Pam"; or black, otherwise:
<cfgridcolumn name = "FirstName" textColor = "(CX EQ Pam ? blue : black)"> |
|||||||||||||||||||||||||
This example displays the text in red if the value in column 1 is greater than four; or black, otherwise:
<cfgridcolumn name = "FirstName" textColor = "(C1 GT 4 ? blue : black)"> |
|||||||||||||||||||||||||
numberFormat mask characters
You can use the following numberFormat attribute mask characters, which correspond to those in the NumberFormat function, to format output in U.S. numeric and currency styles. For more information, see NumberFormat. (This tag does not support international number formatting.)
|
|||||||||||||||||||||||||
Example
For a code example, see cfgrid. |
NAME | |
Required | |
Name of grid column element. If grid uses a query, column name must specify name of a query column. |
HEADER | |
Optional | |
Default value: "Yes"
Column header text. Used only if cfgrid colHeaders = "Yes". |
WIDTH | |
Optional; see Description | |
Default value: "Column head width"
Column width, in pixels. |
FONT | |
Optional | |
Default value: "As specified by cfgrid"
Font of data in column. |
FONTSIZE | |
Optional | |
Default value: "As specified by cfgrid"
Size of text in column. |
ITALIC | |
Optional | |
Default value: "As specified by cfgrid"
|
BOLD | |
Optional | |
Default value: "As specified by cfgrid"
|
TEXTCOLOR | |
Optional | |
Color of grid element text in column, or an expression to manipulate color; hex or text. To enter hex value, use the form "##xxxxxx", where x = 0-9 or A-F; use two pound signs or none. You can enter an expression; for example: textColor= "(C2 LT 0 ? red : pink)" This means: If value in Column 2 is less than 0, display value in red; otherwise, display value in pink. See Using expressions in textColor and bgColor attributes.
|
BGCOLOR | |
Optional | |
Color of background of grid column, or an expression to manipulate color. See Using expressions in textColor and bgColor attributes.
|
HREF | |
Optional | |
URL o r query column name that contains a URL to hyperlink each grid column with. |
HREFKEY | |
Optional | |
The query column to use for the value appended to the href URL of each column, instead of the column's value. |
TARGET | |
Optional | |
Frame in which to open link specified in href. |
SELECT | |
Optional | |
|
DISPLAY | |
Optional | |
Default value: "Yes"
|
TYPE | |
Optional | |
|
HEADERFONT | |
Optional | |
Default value: "as specified by cfgrid"
Column header font |
HEADERFONTSIZE | |
Optional | |
Default value: "as specified by cfgrid"
Column header text size, in pixels |
HEADERITALIC | |
Optional | |
Default value: "as specified by cfgrid"
|
HEADERBOLD | |
Optional | |
Default value: "as specified by cfgrid"
|
HEADERTEXTCOLOR | |
Optional | |
Color of grid control column header text.
|
DATAALIGN | |
Optional | |
Default value: "as specified by cfgrid"
Column data alignment:
|
HEADERALIGN | |
Optional | |
Default value: "as specified by cfgrid"
Column header text alignment:
|
NUMBERFORMAT | |
Optional | |
Format for displaying numeric data in grid. See numberFormat mask characters. |
VALUES | |
Optional | |
Formats cells in column as drop-down list boxes; specify items in drop-down list. Example: values = "arthur, scott, charles, 1-20, mabel" |
VALUESDISPLAY | |
Optional | |
Maps elements in values attribute to string to display in drop-down list. Delimited strings and/or numeric range(s). |
VALUESDELIMITER | |
Optional | |
Default value: ", [comma]"
Delimiter in values and valuesDisplay attributes. |