在kendogrid中控制数据格式以及实现求和
2016-04-29 09:51
507 查看
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#"
}
]
} );
$("#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#"
}
]
} );
相关文章推荐
- tomcat警告解决办法:WARNING: An attempt was made to authenticate the locked user
- 【数据库】MySQL性能优化之swap占用高
- 区块链网络动力学对世界的解构和重构
- 集合框架(ArrayList存储字符串并遍历)
- matlab plot三维图形
- idea切换SVN地址图解
- 驱动中获取进程名的正确方法
- PowerShell 总结
- ASP.NET MVC SSO单点登录设计与实现
- [转]分析函数计算移动平均的测试
- 安卓从业者应该关注:Android 6.0的运行时权限
- SQL随机查询,显示行号,查询数据段
- Excel补全日期(日期按顺序补全)
- 从一个div向另一个div里面追加自己的元素
- 非常经典的JAVA编程题(水仙花数)
- easyui validatebox验证
- 【设计模式】正确使用单例模式
- 地方网站赚钱超容易!学会这个就行了
- linux boa服务器配置解析
- Rough Set Theory