ASP.NET MVC& Kendo UI Grid聚合

时间:2014-06-27 20:45:38

标签: c# javascript kendo-ui aggregates

我想在我创建的剑道网​​格中获得所有" 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#)  
            %>

0 个答案:

没有答案