You can define renderer
function in your column.Custom
class definition. If you want to set scope
to column itself, you can do this in initComponent
method:
Ext.define('column.Custom',
{
extend: 'Ext.grid.column.Column',
alias: 'widget.customcolumn',
initComponent: function() {
// set scope property to this, so in renderer this will refers to column itself
this.scope = this;
this.callParent();
},
renderer: function() {
console.log(this);
// your renderer...
}
});
Then you do not need to specify renderer in column config, becaus you have it defined in your column.Custom
class:
{
// defaults
xtype: 'customcolumn',
align: 'center',
flex: 0,
width: 90,
sortable: true,
lockable: false,
locked: false,
//hideable: false,
// end default
text: 'Total',
menuText: 'Total',
id: 'TotalSavingsColumn',
dataIndex: 'Total',
mode: 'none',
unit: '%'
},