footertemplate:"#=kendo.toString(sum,'N2')#" 将合并值保留两位小数点
$("#mainGrid1").kendoGrid({
dataSource: {
type: "json",
transport: {
read: {
url: "@Html.Raw(Url.Action("", ""))",
type: "POST",
dataType: "json",
data: additionalData
}
},
schema: {
data: "Data",
total: "Total",
errors: "Errors"
},
error: function(e) {
display_kendoui_grid_error(e);
// Cancel the changes
this.cancelChanges();
},
pageSize: @(defaultGridPageSize),
serverPaging: true,
serverFiltering: true,
serverSorting: true,
aggregate:[
{
field: "fQty", aggregate: "sum"
}
]
},
pageable: {
refresh: true,
pageSizes: [@(gridPageSizes)]
},
scrollable: false,
//dataBound: onDataBound,
columns: [
{
field: "fQty",
title: "架位数量",
width:90,
type:"Decimal",format:"{0:N2}",
attributes: { style: "text-align: right"},
headerAttributes:{ style: "text-align: center"},
footerAttributes:{ style: "text-align: right"},
aggregates: ["sum"],
footerTemplate: "#=kendo.toString(sum,'N2')#",
groupFooterTemplate: "Sum: #=sum#"
}
]
} );