1
我有一個Kendo網格,並希望使用兩列克里特ClientFooterTemplate(Value2)。KendoUI網格自定義頁腳使用兩個或多個列與MVC包裝
所以,我有:
@(Html.Kendo().Grid<MyGridDto>().Name("grid")
.Columns(columns =>
{
columns.Bound(p => p.Value1)
.ClientFooterTemplate("#= sum #");
columns.Bound(p => p.Value2);
.ClientFooterTemplate (HERE I WANT TO GET SUM OF VALUE3/SUM VALUE 2)
columns.Bound(p => p.Value3).Visible(false);
}
.DataSource(dataSource => dataSource
.Ajax()
.Aggregates(aggregates =>
{
aggregates.Add(p => p.Value1).Sum();
aggregates.Add(p => p.Value2).Sum();
aggregates.Add(p => p.Value3).Sum();
})
.Read(read => read.Action("List", "MyController)) )
)
MyGridDto
public class MyGridDto
{
public decimal Value1 { get; set; }
public decimal Value2 { get; set; }
public decimal Value3 { get; set; }
}
我想顯示使用值2的值3 /總和的總和值2頁腳。我怎樣才能做到這一點?
<div class="k-grid k-widget">
<table class="k-focusable" id="totals" >
<tr>
<td/>
<td/>
<td>
Total price: <span data-bind="text: priceTotal" />
</td>
</tr>
</table>
</div>
請參閱下面的例子:
感謝
感謝您的答覆。我的問題是錯誤的,所以我編輯了更正的信息。你知道我該怎麼做? – Paul
嗨@Paul,我已經更新瞭解決方案,並根據您的問題提供了一個工作示例。如果您有任何問題,請告知我。 –
謝謝,但問題是我已經有了腳註(由ClientFooterTemplate創建)。它的工作很好,當我只用一列的價值工作。有什麼方法可以訪問ClientFooterTemplate中其他列的總和嗎? – Paul