That override only works when the panel has a single tool.
This worked better for me:
Code:
Ext.override(Ext.Panel, {
setIconClass : function(cls){
var old = this.iconCls;
this.iconCls = cls;
if(this.rendered && this.header){
if(this.frame){
this.header.addClass('x-panel-icon');
this.header.replaceClass(old, this.iconCls);
}else{
var img = this.header.child('.x-panel-inline-icon');
if (img) {
img.replaceClass(old, this.iconCls);
}else{
var tool = this.header.last('.x-tool');
if ( tool ) {
Ext.DomHelper.insertAfter(tool, {
tag: 'img', src: Ext.BLANK_IMAGE_URL,
cls: 'x-panel-inline-icon '+ this.iconCls
});
}
else {
Ext.DomHelper.insertBefore(this.header.dom.firstChild, {
tag: 'img', src: Ext.BLANK_IMAGE_URL,
cls: 'x-panel-inline-icon '+ this.iconCls
});
}
}
}
}
}
});