Pregunta

I am using ExtJS 2.3.0

I have a panel and some items inside that

{
    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 is working for me..

Any solutions.

¿Fue útil?

Solución

You could use the bodyStyle configuration property:

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

Otros consejos

In ExtJs 2.3, there is no support for config options "margin, padding" in Ext.Panel.

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

you should go for bodyStyle config option.

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

Hope this helped you.....

Below should also work:

var myForm = new Ext.form.FormPanel ({
title: 'My Form',
width: 400,
height: 250,
padding: '50 10 10 10',
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top