PDA

View Full Version : [FIXED-402][3.1] 'bodyStyle' config no longer applies 'overflow' styles



SamuraiJack1
28 Dec 2009, 5:15 AM
Seems Ext.Panel's 'bodyStyle' config no longer applies the 'overflow-*' styles. Or may be they are overwritten later somehow, because usual call to 'panel.body.applyStyles()' works fine.

See the attached test case (unpack to examples folder).

Condor
28 Dec 2009, 5:32 AM
In Ext 3.1 autoScroll was moved from Ext.Panel to Ext.BoxComponent. Ext.BoxComponent uses setAutoScroll, which overrides any already assigned overflow styles.

IMHO this should be fixed with:

Ext.override(Ext.BoxComponent, {
afterRender : function(){
Ext.BoxComponent.superclass.afterRender.call(this);
if(this.resizeEl){
this.resizeEl = Ext.get(this.resizeEl);
}
if(this.positionEl){
this.positionEl = Ext.get(this.positionEl);
}
this.boxReady = true;
if(Ext.isDefined(this.autoScroll)){
this.setAutoScroll(this.autoScroll);
}
this.setSize(this.width, this.height);
if(this.x || this.y){
this.setPosition(this.x, this.y);
}else if(this.pageX || this.pageY){
this.setPagePosition(this.pageX, this.pageY);
}
}
});

SamuraiJack1
28 Dec 2009, 8:03 AM
Indeed, it definitely should not overwrite custom styles if not specified explicitly.

hendricd
28 Dec 2009, 8:20 AM
My only concern here would be the forceful use of autoScroll:false (which may also wind up in the BoxComponent.prototype one day) coupled with a desire to set overflow-[x|y] only. It would seem this might allow (if documented properly) the most control over that behaviour:


Ext.override(Ext.BoxComponent, {
afterRender : function(){
Ext.BoxComponent.superclass.afterRender.call(this);
if(this.resizeEl){
this.resizeEl = Ext.get(this.resizeEl);
}
if(this.positionEl){
this.positionEl = Ext.get(this.positionEl);
}
this.boxReady = true;
if(this.autoScroll){
this.setAutoScroll(this.autoScroll);
}
this.setSize(this.width, this.height);
if(this.x || this.y){
this.setPosition(this.x, this.y);
}else if(this.pageX || this.pageY){
this.setPagePosition(this.pageX, this.pageY);
}
}
});:-?

Condor
28 Dec 2009, 8:25 AM
That's the override I posted initially, but that makes it impossible to set overflow to hidden using autoScroll:false.

Currently the only component that sets autoScroll:false is GridPanel. The only reason for that is that some users were trying to set it to autoScroll:true, which is bogus for a GridPanel.

hendricd
28 Dec 2009, 8:49 AM
Fixed in SVN ( w / Ext.isDefined(this.autoScroll) ).