The documented way to do this would be the Summary Renderer, the best method for the summary renderer would be the tdCls or tdAttr properties:
text: 'Allocation %',
xtype: 'numbercolumn',
format: '00.00%',
dataIndex: 'allocationAmount',
summaryType: 'sum',
summaryRenderer: function (value, summaryData, dataIndex, rowIndex, colIndex, store, view) {
if (value > 100)
{
summaryData.tdCls = 'text-warning-high'
} else if (value === 100)
{
summaryData.tdCls = 'text-successful';
} else {
summaryData.tdCls = 'text-warning-low';
}
return Ext.String.format('Total: {0}%', value);
},
You can also use the tdAttr version like this:
summaryRenderer: function (value, summaryData, dataIndex, rowIndex, colIndex, store, view) {
if (value > 100)
{
summaryData.tdAttr = 'style="color: #ff0000"';
} else if (value === 100)
{
summaryData.tdAttr = 'style="color: green;"';
} else {
summaryData.tdAttr = 'style="color: yellow;"';
}
return Ext.String.format('Total: {0}%', value);
},
Note the first one would be using css classes, so you need to define the appropriate css classes in your css file :D