本文介绍了如何在使用组时查找嵌套的cfoutput记录计数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
请考虑以下内容:
<cfoutput query="resources" group="type">
<h4>#type#</h4>
<cfoutput>
#name#
</cfoutput>
</cfoutput>
resources.recordcount
记录数,但是有一个优雅的方式来找出嵌套数据的记录数?例如
resources.recordcount
would give me the total number of records, but is there an elegant way of finding out the recordcount of the nested data? e.g
<cfoutput query="resources" group="type">
<h4>#type# (#noofrecords# of #resources.recordcount#)</h4>
<cfoutput>
#name#
</cfoutput>
</cfoutput>
我可能做一些hacky循环,但想知道是否有一种方法使用cfoutput groups。
I could probably do something hacky with loops, but wondered if there was a way of doing it using the cfoutput groups specifically.
推荐答案
恐怕你必须自己计算。
嵌套分组输出没有RecordCount,因为它真的是一样的查询,CF只是
为你做一些格式化。
I am afraid that you would have to do some counting yourself. There is no RecordCount for thenested grouped output, because it is really all the same query, CF is justdoing a little formatting for you.
这篇关于如何在使用组时查找嵌套的cfoutput记录计数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!