PDA

View Full Version : Viewport padding is not being applied correctly



dbassett74
15 Nov 2009, 9:58 AM
I want to specify a 10px padding in a viewport all the way around. However, it only seems to be applying the padding for X and Y, but not Right and Bottom. Here is the code:



vp = new Ext.Viewport({
layout: "fit",
style: {
padding: "10px 10px 10px 10px"
}
});
var container = new Ext.Panel({

});


The panel (container) is padded 10px from X and Y of the viewport, but not the bottom in FireFox and both bottom and right in IE6.

Is this a bug??

shivashankar
26 Feb 2010, 1:18 AM
Youn have to introduce style in items section of viiew port.

Sample


Ext.onReady(function(){
Ext.BLANK_IMAGE_URL = '/javascripts/ext-3.1.0/resources/images/default/s.gif';
Ext.QuickTips.init();
viewport = new Ext.Viewport({
title:'Test App'
,border:false
,header:false
,layout:'fit'
,items:[{xtype:'panel', border:false, style:'padding:10px', html:'test'}]
})
});