1. #1
    Ext User
    Join Date
    Feb 2009
    Location
    Portugal
    Posts
    5
    Vote Rating
    0
    sfssousa is on a distinguished road

      0  

    Default Align items in a formPanel

    Align items in a formPanel


    Hi
    I want align all items in a formPanel to left.

    for the buttons i use buttonAlign, but for the items?

    Code:
    Ext.onReady(function(){
    
        //Ext.QuickTips.init();
        
        var msg = function(title, msg){
            Ext.Msg.show({
                title: title, 
                msg: msg,
                minWidth: 200,
                modal: true,
                icon: Ext.Msg.INFO,
                buttons: Ext.Msg.OK
            });
        };
        
       
        var fp = new Ext.FormPanel({
            renderTo: 'FrameForm',
            fileUpload: true,
            width: 500,
            frame: true,
            title: 'Upload de ficheiros',
            autoHeight: true,
            bodyStyle: 'padding: 10px 10px 0 10px;',
            labelWidth: 50,
            buttonAlign:'center',
            defaults: {
                allowBlank: false,
                msgTarget: 'side'
            },
            items: [{
                xtype: 'textfield',
                fieldLabel: 'Name'
            },{
                xtype: 'combo',
                fieldLabel:'Utilizador',
                store : new Ext.data.JsonStore({
                      url: 'GetUserCombo.php',
                      baseParams: { method: 'get' },
                      root: 'rows',
                      fields:[
                            {name: 'id', type: 'int'},
                            {name: 'nome'}
                          ]
                        }),
                displayField:'nome',
                valueField:'id',
                triggerAction:'all',
                editable:false,
                setHorizontalAlign: 'LEFT'
            },{
                xtype: 'fileuploadfield',
                id: 'form-file',
                emptyText: 'Seleccione uma imagem',
                fieldLabel: 'Imagem',
                name: 'arquivo',
                buttonCfg: {
                    text: '',
                    iconCls: 'upload-icon'
                }
            }],
            buttons: [{
                text: 'Save',
                handler: function(){
                    if(fp.getForm().isValid()){
                        fp.getForm().submit({
                            url: 'IFicheirosTesteSet.php',
                            waitMsg: 'A enviar arquivo...',
                            success: function(fp, o){
                                msg('Sucesso', 'Arquivo "'+o.result.file+'" enviado.');
                                //fp.getForm().reset();
                                fp.reset();
                            },
                            failure: function (fp, o) {        // when saving data failed
                            msg('Erro', 'Erro ao enviar o arquivo - '+o.result.file+' ');
                        }
                        });
                    }
                }
            },{
                text: 'Reset',
                handler: function(){
                    fp.getForm().reset();
                }
            }]
        });
        
    });

  2. #2
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,496
    Vote Rating
    44
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    But there are labels to the left of form items.

  3. #3
    Ext User
    Join Date
    Feb 2009
    Location
    Portugal
    Posts
    5
    Vote Rating
    0
    sfssousa is on a distinguished road

      0  

    Default Align items in a formPanel

    Align items in a formPanel


    Hi
    the labels yes, but te textFields and the combo are centred to the center.
    I need the align to the left

    D'ont have the code here, but example:


    Label1.......__________TextField__________
    label2 ............_______Combo_______
    Label3 .........._____UploadField_____

    I Need:
    Label1 ......._________TextField___________
    label2 ........______Combo_______
    Label3 .......________UploadField___

  4. #4
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,496
    Vote Rating
    44
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    You have some CSS interference.

  5. #5
    Ext User
    Join Date
    Feb 2009
    Location
    Portugal
    Posts
    5
    Vote Rating
    0
    sfssousa is on a distinguished road

      0  

    Default


    hi
    in my html i have one center to center div in the page.

    Is possible is this?

    Code:
    <body>
    <table width="100%" height="100%" border="0">
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td align="center"><div id="FrameForm"></div></td>
        <td>&nbsp;</td>
      </tr>
    </table>
    </body>

  6. #6
    Sencha User
    Join Date
    Mar 2007
    Posts
    7,854
    Vote Rating
    4
    tryanDLS is on a distinguished road

      0  

    Default


    Yes, align=center will likely cause problems.

  7. #7
    Ext User
    Join Date
    Feb 2009
    Location
    Portugal
    Posts
    5
    Vote Rating
    0
    sfssousa is on a distinguished road

      0  

    Default


    thank you very much

    is just that

    I am still beginner, sorry

Thread Participants: 2