custom summary title on grouped rows.

Hi there.
is it possible to make summary rows title like group caption.
eg: group caption = columnHeaderText : key - 10 items
summary row title = sum of key

1 Reply

HJ Hariharan J V Syncfusion Team September 14, 2018 09:24 AM UTC

Hi Hussain, 
  
Query: Is it possible to make summary rows title like group caption. 
  
You can achieve your requirements by using footerTemplate property. Please refer to the below example code, documentation link and sample link. 
 
[app.js] 
var grid = new ej.grids.Grid({ 
        dataSource: data, 
        allowGrouping: true, 
        groupSettings: { showDropArea: false, columns: ['ShipCountry'] }, 
        columns: [ 
            { field: 'OrderID', headerText: 'Order ID', textAlign: 'Right', width: 120 }, 
            . . . . . . . . . . 
            { field: 'Freight', headerText: 'Freight', width: 150, format: 'C2' }, 
            { field: 'ShipCountry', headerText: 'Ship Country', width: 150 } 
        ], 
        height: 290, 
        aggregates: [{ 
                columns: [{ 
                        type: 'Sum', 
                        field: 'Freight', 
                        footerTemplate: 'Total: Sum is ${Sum}'    // you can use summary row title as a custom 
                    }] 
            }] 
    }); 
    grid.appendTo('#Grid'); 
 
Sample               : https://stackblitz.com/edit/zqsn1z?file=index.js 
 
Regards, 
Hariharan 


Loader.
Up arrow icon