|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
Nested cfoutput with query, group & maxrows problem
Ok, for example say I have the following :
Code:
<cfoutput query="#someQuery#" group="colA" startrow="#startRow#" maxrows="#maxRows#">
<h3>#colA#</h3>
<cfoutput>
other data from the query
</cfoutput>
</cfoutput>
Now I only want the total number of records that are output to be the value of maxrows. However it appears the maxrows is being applied to the outer cfoutput loop and not the inner, I can't apply a maxrows to the inner loop as you need to combine that attribute with a query. I'm going to fudge it a little with cfloops instead, but does anyone have any cleaner suggestions? -D |
|
#2
|
|||
|
|||
|
I've never had to do this before. You might have to check the queryname.currentRow value within the inner cfoutput and limit the number of records there.
It seems strange to me that you would NOT want the inner cfoutput to always finish its work. If you were outputting 3 makes of cars, and within each make of car you had 10 models, that would be a total of 30 records. If you artificially slapped a 25 record limit on the cfoutput, then you'd lose the last 5 models of the third make. That doesn't make sense to me. You could also consider limiting the number of records returned by the query itself using the maxRows attribtue of cfquery.
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian. How to Post a Question in the Forums |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > Nested cfoutput with query, group & maxrows problem |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|