PDA

View Full Version : Bug: Ext.Panel margin, padding, border



mrsunshine
18 May 2010, 10:58 AM
There is a bug if you add one of the following properties to a Ext.Panel:


margin
padding
padding

the bug occurs in the onRender function:

example:


...
if (this.padding != undefined) {
bodyCfg.style +=
'padding: ' +
Ext.Element.parseBox((this.padding === true) ? 5
: this.padding) + ';';
}
...
reason:

Ext.Element.parseBox()returns an object but it must be a string for the style string concatenation

result:
the styles for padding, margin or border are not added to the Panel


testscript:


Ext.onReady( function() {
new Ext.Panel({
fullscreen: true,
renderTo: Ext.getBody(),
padding: 20,
border: 10,
margin: 35,
html: 'padding test'
});
});

TommyMaintz
18 May 2010, 11:08 AM
Hey Nils,

Thanks for the report. I haven't really looked into / used the padding / border / margin properties on components. I usually set them in CSS which is where it belong imo. I will make sure they work in an upcoming release though. Note: if you are using margin on a panel that is docked, it won't take those margins into account yet.

mrsunshine
18 May 2010, 11:13 AM
Hey Nils,

Thanks for the report. I haven't really looked into / used the padding / border / margin properties on components. I usually set them in CSS which is where it belong imo.
yes off course ;-)

i stumbled over this while writing the first ten lines of code of my first ext touch test application.
i post it because that the beta test is for ;-)

I will make sure they work in an upcoming release though. Note: if you are using margin on a panel that is docked, it won't take those margins into account yet.
great and thx for the tip