PDA

View Full Version : [OPEN-1428] BUG with Ext TreePanel+ tbar + IE = no go



winit
17 Nov 2010, 11:12 AM
Setup
IE8
EXT 3.3

Component
EXT.tree.TreePanel

If you add a TreePanel to a page with a tbar sepecified, the tree will fail to render. (IE8 only) Firefox and Chrome render the tree fine.

I was able to track down the problem and fix it. Attached is the treesetup

This problem can be fixed by changing the following two methods in ext-all.js as follows

add : function(comp){
this.initItems();
var args = arguments.length > 1;
if(args || Ext.isArray(comp)){
var result = [];
Ext.each(args ? arguments : comp, function(c){
if(c != undefined) //add this
result.push(this.add(c));
}, this);
return result;
}
var c = this.lookupComponent(this.applyDefaults(comp));
var index = this.items.length;
if(this.fireEvent('beforeadd', this, c, index) !== false && this.onBeforeAdd(c) !== false){
this.items.add(c);

c.onAdded(this, index);
this.onAdd(c);
this.fireEvent('add', this, c, index);
}
return c;
},

onAdd : function(c){

},


setStyle : function(prop, value){
var tmp, style;

if (typeof prop != 'object') {
tmp = {};
tmp[prop] = value;
prop = tmp;
}
for (style in prop) {
value = prop[style];
if(value == 'NaNpx') //add this
value = '0px'; //add this

style == 'opacity' ?
this.setOpacity(value) :
this.dom.style[chkCache(style)] = value;
}
return this;
},