我正在使用 Angular/ng-table 以表格形式绘制数值数据。
我无法弄清楚如何在表末尾引入一行,该行显示每列所有值的总和。
我可以在服务器端计算数据并将其呈现在用户界面中。
但有没有办法在 ng-table/ng-grid 中实现这一点呢?
任何帮助将不胜感激。
thanks
你的意思是这样的吗?
<table ng:init="stuff={items:[{description:'gadget', cost:99},{description:'thing', cost:101} ]}">
<tr>
<th>Description</th>
<th>Cost</th>
</tr>
<tr ng:repeat="item in stuff.items">
<td>{{item.description}}</td>
<td>{{item.cost}}</td>
</tr>
<tr>
<td></td>
<td>{{stuff.items.$sum('cost')}}</td>
</tr>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)