我想在GSP页面中总结总成本,现在我得到所有值的列表.即时通讯使用以下代码:
<g:each in="${costList}" var="cost">
<tr>
<td>${cost.amount}</td>
</tr>
</g:each>
Run Code Online (Sandbox Code Playgroud)
我怎么能在grails GSP页面中这样做.谢谢!!
这应该这样做:
${costList.sum { it.amount } }
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1817 次 |
| 最近记录: |