Results 1 to 4 of 4

Thread: hbox margin problem

  1. #1
    Sencha User
    Join Date
    Jan 2010
    Posts
    91

    Default hbox margin problem

    Hi,
    i have a panel that needs to show two panels inside, one beside the other. So i use hbox layout but i need some space between the 2 horizontal panels. The margin and the anchor properties doesnt work.

    Thanks


    var panel = new Ext.Panel({
    title: "Info",
    anchor:'100% 50%',
    layout: 'hbox',
    style: {
    padding: '10px'
    },
    //width:200,
    items: [
    {
    xtype: 'panel',
    title: 'Panel 1',
    html: 'panel 1',
    anchor: '50% 50%',
    style: {
    padding: 'margin:10px'
    }
    },
    {
    xtype: 'panel',
    title: 'Panel 2',
    html: 'panel 2',
    anchor: '50% 50%'
    }
    ]
    });

  2. #2
    Sencha User
    Join Date
    Aug 2008
    Location
    Minnesota
    Posts
    24

    Exclamation Clearer example of issue

    Here is a clearer example. This is also visible in Ext Designer. It seems that it ignores the first value in the string version of margins.
    Code:
     {
        xtype: 'panel',
        layout: {
            type: 'hbox',
            defaultMargins: 8
              },
                                
        items: [
            {
                flex: 1,
                xtype: 'fieldset',
                margin: 8
                                         
            },{
                flex: 1,
                xtype: 'fieldset',
                margin: '10 10 10 10'
                    },{
                flex: 1,
                xtype: 'fieldset',
                margin: {top: 10, left: 10, right: 10, bottom: 10}
            }
        ]
    }

  3. #3
    Sencha Premium Member
    Join Date
    Mar 2010
    Posts
    63

    Default

    try to add this to your second and third fieldset
    style:'padding-left:10px;'

    or maybe add this below to your panel

    bodyStyle: 'padding:5px 5px 0',

  4. #4
    Sencha User
    Join Date
    Aug 2008
    Location
    Minnesota
    Posts
    24

    Default

    The point of the bug is that it is a bug and needs to be resolved. The margins config options works if you prefix it with a space such as:

    Code:
       margins: ' 10 10 10 10',
    
    //or
    
       margins: ' 10',

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •