This content has been marked as final. Show 2 replies
Sorry, my initial search to find the answer came up nill. When I searched again I found the answer which I'm pasting below. It worked great.
when you use the GROUP attribute of CFOUTPUT, your data is no longer being output in the same order in which it was retrieved. the CURRENTROW variable is no longer in chronological order (you're displaying the first grouped element, then 1-n members of that group, then repeating).
you'd need to set an iterating variable.
<cfset myRowCountVar = 0 />
<cfoutput query="q_remnts_f3" group="req_Cat">
<cfset myRowCountVar = myRowCountVar + 1 />
(now use 'myRowCountVar' to key off of to determine the background color rather than currentrow)
charlie griefer (CJ)
@ #coldfusion / DALnet
<tr bgcolor="#IIf(query.currentRow Mod 2, DE('cfcfcf'), DE('eeeeee'))#">
Create your own counter. CurrentRow will always be the current row of
the query no matter what group it maybe in. So create your own counter
and increment it in the loop that relates to the rows you want to color,
then use this variable in your iif() function.
<cfset myCounter = 1>
<cfoutput query="foo" group="bar">
<tr bgcolor="#IIF(myCounter Mod 2, DE('cfcfcf'), DE('eeeeee'))#">
<!--- whatever you do here --->
<cfset myCounter = myCounter + 1>