Results 1 to 3 of 3

Thread: Form panel buttons alignment

  1. #1
    Sencha User
    Join Date
    Feb 2012
    Posts
    59
    Vote Rating
    0
      0  

    Default Answered: Form panel buttons alignment

    Hi together

    How do I have to change the following code, so that the buttons "Button Left 1" and "Button Left 2" will be aligned on the of the form and the buttons "Button Right 1" and "Button Right 2" will be aligned on the right of the form?
    Code:
    Ext.onReady(function () {
        Ext.create('Ext.container.Viewport', {
            layout: 'border',
            items: [{
                region: 'center',
                border: false,
                layout: 'fit',
                items: [
                    form
                ]
            }]
        });
    });
    
    var form = Ext.create('Ext.form.Panel', {
        frame:true,
        title: 'Simple Form',
        bodyStyle:'padding:5px 5px 0',
        fieldDefaults: {
            msgTarget: 'side',
            labelWidth: 75
        },
        defaultType: 'textfield',
        defaults: {
            anchor: '100%'
        },
    
    
        items: [{
            fieldLabel: 'First Name',
            name: 'first',
            allowBlank: false
        },{
            fieldLabel: 'Last Name',
            name: 'last',
            allowBlank: false
        }],
    
    
        buttons: [{
            text: 'Button Left 1'
        },{
            text: 'Button Left 2'
        },{
            text: 'Button Right 1'
        },{
            text: 'Button Right 2'
        }]
    });
    Thanks for your support!
    extjser12


  2. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,380
    Answers
    3997
    Vote Rating
    1524
      0  

    Default

    Try inserting a spacer component to space out the buttons.
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Frontend Engineer
    ________________
    Need any sort of Ext JS help? Modus Create is here to help!

    Check out my GitHub:
    https://github.com/mitchellsimoens

  3. #3
    Sencha User
    Join Date
    May 2010
    Location
    Kiev, Ukraine
    Posts
    156
    Answers
    15
    Vote Rating
    9
      0  
    Vitaliy Khmurach
    Web Developer
    https://ext4all.com

Posting Permissions

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