-
27 May 2009 3:18 PM #1
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(); } }] }); });
-
28 May 2009 12:01 AM #2
But there are labels to the left of form items.
Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
28 May 2009 4:57 AM #3
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___
-
28 May 2009 5:16 AM #4
You have some CSS interference.
Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
28 May 2009 6:49 AM #5
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> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td align="center"><div id="FrameForm"></div></td> <td> </td> </tr> </table> </body>
-
28 May 2009 7:29 AM #6
Yes, align=center will likely cause problems.
Tim Ryan
Read BEFORE posting a question / BEFORE posting a Bug
Use Google to Search - API / Forum
API Doc (4.x | 3.x | 2.x | 1.x) / FAQ / 1.x->2.x Migration Guide / 2.x->3.x Migration Guide
-
28 May 2009 4:07 PM #7
thank you very much
is just that
I am still beginner, sorry


Reply With Quote