Dave Merrill
07/22/2022, 3:24 PMTim
07/22/2022, 3:35 PMattributeColletion
struct. Rather than specifying each attribute separately, you can specify them in a struct, and then pass that to the tag as <cftag attributeCollection="#someStruct#">
So then you've have like
outputAttributes = { query: q };
if( groupExists() ) {
outputAttributes.group = "someColumn";
}
<cfoutput attributeCollection="#outputAttributes#">
If there's nothing to group by, then it excludes the group attribute entirely.Dave Merrill
07/22/2022, 3:45 PMTim
07/22/2022, 3:45 PMDave Merrill
07/22/2022, 3:47 PMwebsolete
07/22/2022, 3:56 PMwebsolete
07/22/2022, 3:58 PMwebsolete
07/22/2022, 3:58 PMDave Merrill
07/22/2022, 4:11 PMwebsolete
07/22/2022, 4:52 PM<cfset groupColumn = false>
<cfset lastGroup = "">
<cfoutput query="q">
<cfif groupColumn and lastGroup neq q.parentGroup>
<h3>#q.parentGroup#</h3>
<cfset lastGroup = q.parentGroup>
</cfif>
id: #id#, name: #name#<br>
</cfoutput>
websolete
07/22/2022, 4:53 PMDave Merrill
07/25/2022, 1:06 PM