I am looking to hide/unhide an icon which I have added in action column based on the row data I get. I tried using the getClass function, but the icon never shows up in any scenario. Without using the getClass function and just using the icon key, I was able to show the icon all the time (commented out in the code below). What am I missing here?
this.columns = [{
xtype: 'actioncolumn',
itemId:'invalid_icon',
sortable: false,
menuDisabled: true,
cls:'table_invalid_icon',
width: 70,
items: [{
getClass: function(Value, metaData, record){
if(record.data.name !== 'test' ){
return "hideDisplay";
}else{
return "showIcon";
}
}
//icon: 'image.svg'
}]
}]
I have the corresponding css as below:
.showIcon{
background:url('image.svg');
}
.hideDisplay{
background:none;
}
I have also verified the if condition and the condition has the correct value. Any ideas on what I am missing?
Why do you use brackground instead of icon property? Is the icon dynamic or static?
And working sample: