1. #1
    Sencha User
    Join Date
    Nov 2011
    Posts
    9
    Vote Rating
    0
    domurtag is on a distinguished road

      0  

    Default Align button in FieldSet

    Align button in FieldSet


    Using Ext JS 2.3.0 I've created a FieldSet that looks like this

    fieldset.jpg

    I would like the Remove Condition button to appear underneath the input fields instead of under the labels, my code is:
    Code:
            var kpiUpper = new Ext.form.TextField({
                fieldLabel: "Higher",
                name: 'upperBound',
                allowBlank: true
            });
    
            var kpiFilterFieldset = new Ext.form.FieldSet({
                jsonForm: true,
                jsonType: 'object',
                jsonName: 'kpiFilter',
                title: locale['label.kpi.condition'],
                checkboxToggle: true,
                collapsed: true,
                autoHeight:true,
                items : [
                     /* code to add first input box and combo box omitted */
                    kpiUpper,
                    {
                        xtype: 'button',
                        text: 'Remove Condition',
                    }
                ]
            });
    I know I could do this by setting a left margin on the button of the appropriate number of pixels, but is there a better way?

  2. #2
    Sencha User darthwes's Avatar
    Join Date
    Mar 2010
    Posts
    633
    Vote Rating
    -11
    darthwes can only hope to improve

      0  

    Default


    All panels have

    buttonAlign
    : String

    The alignment of any buttons added to this panel. Valid values are 'right', 'left' and 'center' (defaults to 'right').
    Defaults to: "right"


    Fieldsets are panels. GL, Happy hunting.


    Wes

  3. #3
    Sencha User
    Join Date
    Nov 2011
    Posts
    9
    Vote Rating
    0
    domurtag is on a distinguished road

      0  

    Default


    Thanks for your answer. So if I add my button to the buttons property (instead of items), I guess I can centre it, but that probably won't align it with the input fields.

    Is it possible to have it aligned with the left edge of the input fields above?

  4. #4
    Sencha User darthwes's Avatar
    Join Date
    Mar 2010
    Posts
    633
    Vote Rating
    -11
    darthwes can only hope to improve

      0  

    Default


    Sure, put button in a compositefield.
    Wes

  5. #5
    Sencha User
    Join Date
    Nov 2011
    Posts
    9
    Vote Rating
    0
    domurtag is on a distinguished road

      0  

    Default


    There is no CompositeField in 2.3.0

Thread Participants: 1