View comments | RSS feed

cfgridrow

Description

Lets you define a cfgrid control that does not use a query as source for row data. If a query attribute is specified in the cfgrid tag, the cfgridrow tags are ignored.

Category

Forms tags

Syntax

<cfgridrow 
data = "col1, col2, ...">

See also

cfgrid, cfgridcolumn, cfgridupdate, cfform, cfinput, cfselect, cfslider, cftextarea, cftree

Attributes

Attribute Req/Opt Default Description

data

Required

 

Comma-delimited list of column values. If a value contains a comma, it must be escaped with another comma.

Example

The following example shows how you use the cfgridrow tag can populate a cfgrid tag from list data:

<!--- Set two lists, each with the data for a grid column. --->
<cfset cities = "Rome,Athens,Canberra,Brasilia,Paris">
<cfset countries = "Italy,Greece,Australia,Brazil,France">

<cfform name = "cities">
   <cfgrid name="GeoGrid" autowidth = "yes" vspace = "4" 
         height = "120" font="tahoma" rowheaders="no">
      <cfgridcolumn name="City" header="City">
      <cfgridcolumn name="Country" header="Country">
      <!--- Loop through the lists using cfgridrow to poplulate the grid. ---> 
      <cfloop index="i" from="1" to="#ListLen(cities)#">
         <cfgridrow data ="#ListGetAt(cities, i)#,#ListGetAt(countries, i)#">
      </cfloop>
   </cfgrid><br><br>
</cfform>

ColdFusion 9 | ColdFusion 8 | ColdFusion MX 7 | ColdFusion MX 6.1 | ColdFusion MX | Forums | Developer Center | KnowledgeBase | Bug Reporting

Version 7

Comments


nitrog7 said on Mar 9, 2005 at 9:33 AM :
There may be a bug with escaping a comma (unless it is done another way). Even when replacing commas using the code below, my string is still pushed to the next row. I wish there was a delimiter attribute for the cfgridrow tag or at least use something less common such as a '|'. I have also tried replacing the comma with:
,,
&comma;
&#044;
#chr(44)#

replace(description,",",",,","ALL")
markg454 said on Jun 8, 2005 at 2:14 PM :
I have the same issue with escaping the comma in a display field. It does not work like advertised. I tried this:

<cfset curdisplayname = Replace(DisplayName,",",",,","ALL")>

To no avail. I have a display name of the form:

Last name, Firsts name

which I need to preserve. Any ideas Macromedia?
jrunrandy said on Jul 13, 2005 at 9:34 AM :
This is in our bugtracker as bug number 60010.

As far as I know, there isn't a workaround, but you might try asking on the forums.
jbyrd said on Dec 10, 2005 at 10:15 AM :
#Replace(myVar, ',', '&##44;', 'All')# has been working for me.

 

RSS feed | Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/coldfusion/7/htmldocs/00000268.htm