How can I remove the icon in this actioncolumn item within its handler?
{
header: 'Activate',
xtype: 'actioncolumn',
align: 'center',
width: 30,
sortable: false,
items: [{
icon: './Scripts/extjs/examples/shared/icons/fam/accept.png',
tooltip: '',
handler: function (grid, rowIndex, colIndex) {
var rec = grid.getStore().getAt(rowIndex);
if (rec.get('status') == '1') { // if active, don't show icon
this.up('actioncolumn').icon = '';
}
}
...
In general, it can’t – configs are applied at initialization time, and sadly the ExtJS API doesn’t always provide ways to change things as easily as they are specified in configs.
In the case of an ActionColumn, you can see in the source that the
iconis used to generate a renderer function in the constructor and there’s no way to set it afterwards.To dynamically decide whether to show an icon or not, you’ll need to use
iconClsinstead, see here.