我想在我创建的剑道网格中获得所有" TransactionAmount" s的总和。我有以下代码,我收到一个JavaScript错误,说“' sum'未定义。
你能告诉我我做错了什么吗?
<%: Html.Kendo().Grid<Transactions>()
.Name("grid_#=AccountNumber#")
.Columns(c =>
{
c.Bound(m => m.TDate).Title("Transaction Date").ClientFooterTemplate("Total:");
c.Bound(m => m.TransactionAmount).Title("Transaction Amount").Format("{0:c}").ClientFooterTemplate("#= sum #");
c.Bound(m => m.UserName)
c.Bound(m => m.Address1)
c.Bound(m => m.City)
c.Bound(m => m.State)
})
.DataSource(dataSource => dataSource
.Ajax()
.Aggregates(v => { v.Add(p => p.TransactionAmount).Sum(); })
.Read(read => read.Action("GetTransactions", "Reports", new { startDate = Model.StartDate, endDate = Model.EndDate, accountNumber = "#=AccountNumber#" }))
)
.Sortable()
.ToClientTemplate(#=sum#)
%>