PDA

View Full Version : [PATCH] setIconCls fails if header is unrendered



KampfCaspar
15 Jun 2011, 3:32 AM
Ext.panel.Header.setIconCls does not respect the condition that the header might no-yet be rendered. The Header's rendering may - however - be independent of the 'main' panels rendering.

E.g.: Loading a background tab in a tabpanel.

Instead of correctly falling back in all custom objects (which would include custom iconchange event handling et al), I suggest handling the not-yet-rendered case directly in Ext.panel.Header. The attached patch works for me so far ;)


diff --git a/src/panel/Header.js b/src/panel/Header.js
index 92520f9..d5cee2f 100644
--- a/src/panel/Header.js
+++ b/src/panel/Header.js
@@ -290,9 +290,6 @@ Ext.define('Ext.panel.Header', {
*/
setIconCls: function(cls) {
this.iconCls = cls;
- if ( !this.rendered ) {
- return;
- }
if (!this.iconCmp) {
this.initIconCmp();
this.insert(0, this.iconCmp);