How to Create a Footertemplate for KoGrid?

307 views Asked by At

How can I create footer Template for a koGrid to display sum of a column?

 gridOptions : {
        displaySelectionCheckbox: false,
        data: items,
       // selectedItems: self.selectedItems,
        multiSelect: false,

        enableColumnResize: true,

        columnDefs: [
                      { field: 'fun_id', displayName: 'fun_id', visible: false },
                      { field: 'test', displayName: 'Test' },
                      { field: 'details', displayName: 'Details'},
                      { field: 'qty', displayName: 'Qty' },
                      { field: 'price', displayName: 'Price' },
                      { field: 'discount', displayName: 'Discount' },
                      { field: 'empno', displayName: 'EmpNo' },
                      { field: 'promo', displayName: 'Promo' },
                      { field: 'Delete', cellTemplate: myCellTemplate, width: 60 },
        ]
    }

enter image description here

Here I want to print the sum of 'price' field as Total in Footer.How can I achieve this?

1

There are 1 answers

0
Barry On

From looking at the Kendo aggregation demo all you need to do is define an aggregate property