Kendo grid not show sum in footer template

时间:2015-04-23 05:18:34

标签: javascript kendo-ui kendo-grid

I used kendo grid to load data, I have a problem. aggregate sum not working correct with json data below,Total value only get last row cell value. If i change another json data it working.

var ds = [
    {
        "SubName": "To PN 01-001", "SubID": "1",
        "Partner": "93",
        "INFDivName": "Phuong Nam-01",
        "Vigor2910wifi": "28"
    },
    {
        "SubName": "To PN 01-002",
        "SubID": "2", "Partner": "93",
        "INFDivName": "Phuong Nam-01",
        "Vigor2910wifi": "3"
    },
    {
        "SubName": "To PN 01-010",
        "SubID": "10", "Partner": "93",
        "INFDivName": "Phuong Nam-01",
        "Vigor2910wifi": "5"
    }
];


var cls = [
  new ExtColumn("Vigor2910wifi", "Cap", 300, null, false,null, null, "total #=sum#")
];            


var dataSource = new kendo.data.DataSource({
    data: ds,
    pageSize: 20,
    aggregate: [new ExtAggregate("Vigor2910wifi", "sum")],

})

var kendoGrid = $("#gridEQReportDebtBySub").kendoGrid({
    dataSource: dataSource,
    sortable: true,
    resizable: true,
    reorderable: true,
    pageable: true,
    columnMenu: true,
    columns: cls                    
})

I found problem, I change
"Vigor2910wifi": "3" to "Vigor2910wifi": 3

This worked.

0 个答案:

没有答案