【发布时间】:2013-11-25 09:37:41
【问题描述】:
我想对我的剑道网格中的值求和以形成其总数,
为此,我正在使用类似剑道网格,
@(Html.Kendo().Grid<Invoice.Models.ViewModels.SupplementViewModel>()
.Name("Supplement")
.TableHtmlAttributes(new { style = "height:20px; " })
.Columns(columns =>
{
columns.Bound(p => p.SupplementID).Hidden(true);
columns.Bound(p => p.Description).Title("Description").Width(15);
columns.Bound(p => p.Nett).Title("Nett").Width(15).HtmlAttributes(new { @class="Currency"});
columns.Bound(p => p.Tax).Title("Tax").Width(15).HtmlAttributes(new { @class = "Currency" });
columns.Bound(p => p.GST_VAT).Title("GST_VAT").Width(15).HtmlAttributes(new { @class = "Currency" });
columns.Bound(p => p.ServiceTax).Title("ServiceTax").Width(15).HtmlAttributes(new { @class = "Currency" });
columns.Bound(p => p.ServiceFee).Title("ServiceFee").Width(15).HtmlAttributes(new { @class = "Currency" });
columns.Bound(p => p.Total).Title("Total").Width(15).HtmlAttributes(new { @class = "Currency" });
})
.Editable(editable => editable.Mode(GridEditMode.InCell))
.Navigatable()
.Sortable()
.Scrollable(scr => scr.Height(200))
.Scrollable()
.DataSource(dataSource => dataSource
.Ajax()
.Batch(true)
.ServerOperation(false)
.Events(events => events.Error("error_handler"))
.Model(model =>{
model.Id(p => p.ProductTypeCode);
})
.Create("Editing_Create", "Grid")
.Update("Editing_Update", "Grid")
.Destroy("Editing_Destroy", "Grid")
)
)
场景是这样的::
我想在“总计”中显示值的总和取决于那里的变化, 如何做呢?请帮我解决这个问题。
【问题讨论】:
-
但是聚合用于特定列的聚合,在我的场景中,我想要总计所有列的总和。
-
我猜你需要行(而不是列)的总和。所以
Sum = Total = SUM(Nett, Tax, GST_VAT...)。如果是这种情况,您可以从控制器进行求和。
标签: javascript jquery asp.net-mvc kendo-ui kendo-grid