启用汇总网格;
Ext.create('Ext.grid.Panel', {
features: [{
ftype: 'summary'
}],
在需要的列中添加summaryType配置;
columns: [{
dataIndex: 'name',
text: 'Name',
summaryType: 'sum',
...
自定义summaryType看起来像;
dataIndex: 'subtotal',
text: 'SubTotal',
summaryType: function(records){
return 100*100;//custom function
}
简单的css添加来改变extjs网格摘要行的背景颜色;
.x-grid-row-summary {
background-color: #efefef;
}
自定义SummaryRender;
{
dataIndex: 'count',
text: 'Count',
summaryType: 'count',
summaryRenderer: function(value, summaryData, dataIndex) {
return (value && value>100)?"<font color='red'>"+value+"<font>":value;
}
},
发布于 2013-11-11 09:51:20
只需在下面添加css样式
.x-grid-row-summary {
background-color: #efefef;
}
https://stackoverflow.com/questions/19903319
复制相似问题