0
votes

Enable summary grid;

Ext.create('Ext.grid.Panel', {
            features: [{
                ftype: 'summary'
            }],

Add a summaryType config to the columns you need;

columns: [{
    dataIndex: 'name',
    text: 'Name',
    summaryType: 'sum',
...

custom summaryType looks like;

dataIndex: 'subtotal',
text: 'SubTotal',
summaryType: function(records){
    return 100*100;//custom function
} 

Simple css addition to change background color of the summary row of extjs grid;

.x-grid-row-summary {
    background-color: #efefef;
}

Custom SummaryRender;

{
     dataIndex: 'count',
     text: 'Count',
     summaryType: 'count',
     summaryRenderer: function(value, summaryData, dataIndex) {
         return (value && value>100)?"<font color='red'>"+value+"<font>":value; 
     }
},
1
you have any question or posting about changing bgcolor of summary row of grid?Surya Prakash Tumma

1 Answers

2
votes

Just add below css style

.x-grid-row-summary {
    background-color: #efefef;
}