I have a grid panel like:
Ext.define('Demo.view.main.content.source.Ex', {
extend: 'Ext.grid.Panel',
requires: [
'Demo.store.main.content.source.Ex',
'Demo.view.main.content.source.ExController',
],
xtype: 'app-main-content-ex',
title: 'Example',
store: 'Demo.store.main.content.source.Ex',
controller:'main-content-source-ex',
//multiSelect: false,
columnLines: true,
initComponent: function() {
var store = Ext.create('Demo.store.main.content.source.Ex', {
storeId: 'app-main-content-source-exstore'
});
Ext.apply(this, {
store: store
});
this.columns= [
{
text : 'Driver Name',
flex : 3,
sortable : false,
dataIndex: 'name'
},
{
xtype: 'gridcolumn',
getEditor: function(record) {
console.log(record.get('state'));
var value;
if (record.get('state') == 'free') {
value = 'xf09c@FontAwesome'
} else {
value = 'xf023@FontAwesome'
}
return Ext.create('Ext.grid.CellEditor', {
field:{
xtype: 'image',
glyph: value
}
});
},
text : 'State',
flex : 1,
dataIndex: 'state'
}]
this.callParent();
},
listeners:{
afterRender: 'setUpInfo'
}
});
I am loading the store of that in grid afterrender event. I want to set the image in the State column based on the value of state(free/busy). Its not working.
How should I do it?