How to specify padding / margins for elements inside ExtJS panel

I use ExtJS 2.3.0

I have a panel and some elements inside

{
    xtype: 'panel',
    border: false,
    margin: '10px;' // Not working for me
    items: [
            { boxLabel: 'One', xtype: 'checkbox' },
            { boxLabel: 'Two', xtype: 'checkbox' }
    ]
}

I tried using margin, padding ... none of them work for me.

Any decisions.

+4
source share
2 answers

You can use the bodyStyle configuration property :

{
    xtype: 'panel',
    border: false,
    bodyStyle: 'margin: 10px;'
    items: [
        { boxLabel: 'One', xtype: 'checkbox' },
        { boxLabel: 'Two', xtype: 'checkbox' }
    ]
}
+7
source

In ExtJs 2.3 does not support the configuration parameters "margin, padding" in Ext.Panel .

Check the documentation http://docs.sencha.com/extjs/2.3.0/#!/api/Ext.Panel

bodyStyle.

{
     xtype: 'panel',
     border: false,
     bodyStyle: 'margin: 10px; padding: 5px 3px;',
     items: [
          { boxLabel: 'One', xtype: 'checkbox' },
          { boxLabel: 'Two', xtype: 'checkbox' }
     ]
}

, .....

+6

All Articles