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;
}
},