Hi there everybody
I am having problems with pagination using cfloop and the grouping of cfoutput in nested cfoutput tags.
The code below lists my results eg:
producer
query results
producer
query results
producer
query results
etc

what i require is eg
producer 1
query results 1
query results 2
query results 3
producer 2
query results 1
query results 2
query results 3
etc etc

I have been belting my head against the wall with this for 2 days now and its getting to the frustratyion boil over time????

the page works fine UNTILL i introduce the cfloop for the pagination so this appears to be where my problems are as i cannot use the 'group' attribute in a cfloop query, - that would be to easy eh?

If anyone can help with this it would be very much appreciated

<!---PAGINATION (WITHIN <tr> TAG) loop to show 10 query results at a time--->
<cfloop query="getproducts" startrow="#URL.offset#" endrow="#limit#">
<cfoutput group="producer">
<table width="610" border="0" align="center" cellpadding="0" cellspacing="0">
<!---<cfset rowCounter = 0>--->
<tr valign="middle" class="smalltext11light">
<td colspan="5"><img src="siteImages/5pxSpacer.gif" width="57" height="5"></td>
</tr>
<tr valign="middle" class="smalltext11light">
<td colspan="5"><div align="left" class="smalltext11redbold"><strong> <span class="smalltext11redbold">#UCase(getproducts.producer)#</span></strong></div></td>
</tr>
<tr valign="middle" class="smalltext11light">
<td colspan="5"><img src="siteImages/5pxSpacer.gif" width="50" height="5"></td>
</tr>
<!--- ends set anchors--->
<!---Lists listings by Town--->
<cfoutput> 
<tr>
<td width="72" rowspan="2" valign="top" ><cfif getproducts.prodImage neq ''>
<a href="productCatDetails.cfm?ID=#getproducts.ID#"><img src="prodImages/#getProducts.prodImage#" border="0"></a>
<cfelse>
<a href="productCatDetails.cfm?ID=#getproducts.ID#"><img src="prodImages/noImageLoaded.gif" border="0"></a>
</cfif></td>
<td width="468" valign="top" class="smalltext11light capitalize"><strong>#getproducts.prodname#</strong> - (#getproducts.weight#)</td>
<td width="70" align="right"class="smalltext11light"><a href="productCatDetails.cfm?ID=#getproducts.ID#"><img src="siteImages/catMoreInfo.gif" name="catMore" width="89" height="16" border="0" id="catMore"></a></td>
</tr>
<tr>
<td valign="top" class="smalltext11light">#getproducts.prodDesc#<br>
<br></td>
<td align="right"class="smalltext11light"></td>
</tr>
<tr>
<td colspan="3" valign="top" ><hr size="1" noshade></td>
</tr>
<!--- <cfset rowCounter=rowCounter+1>--->
</cfoutput>
<!--- ends town listings
<cfset rowCounter = 0>--->
</table>
</cfoutput>
<!---END PAGINATION LOOP --->
</cfloop>

many thanks in advance
grabit

I am having problems with pagination using cfloop and the grouping of cfoutput

Trying to combine cfloop start/endRow and a grouped output is just asking for pain. I honestly doubt it's possible. You either need to do real pagination ie only return x records in the query or drop the grouped output.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.