-
11 May 2007 12:59 PM #1
Ext.form.Button
Ext.form.Button
I often got myself into a situation where I needed to add a button into a form.
Next to all the checkboxes and text fields, it would have been so usefull to have a Ext.form.Button.
Yes, I know you can addButton() to a form, but those go down to the bottom and I needed some of the buttons to "stay in context" and be rendered inside the fieldset.
Anyway... long story short I've merged part of Ext.Button and Ext.form.Field into a new class.
PHP Code:form.add(
new Ext.form.Button(
{fieldLabel:'Reset Password',
text:'Reset',
icon:'key.gif',
cls:'x-btn-text-icon',
handler:function(){alert('clicked');},
descriptionText:'click here to reset your password'
}));
-
7 Aug 2007 4:17 PM #2
buttons in the form
buttons in the form
Hoorah. This is exactly what I needed too. You rock.

-
22 Aug 2007 4:13 PM #3
Thanks! This worked perfectly for me, awesome work

-
18 Nov 2007 5:17 AM #4
Re:Ext.form.Button
Re:Ext.form.Button
Thanks!
Helped me lot.
Zaman
-
14 Jan 2008 8:27 AM #5
-
15 Jan 2008 7:01 PM #6dddu88Guest
Hi, all,
One issue to me is that I donot want fieldLabel for the button, but I cannot find a way to get rid of the label, if I configure it to hidelabel: true, then the button will not be lined up with the TextField, if I comment out the fieldLabel, then there will be a ":" shown up as an empty label, anybody has a way to solve this problem? Thanks in advance.
My code is like this:
Code:var formbtn = new Ext.form.Button( {//fieldLabel:'Query database', hideLabel : true, text:'Retrive', icon:'images/key.gif', cls:'x-btn-text-icon', handler:function(){alert('clicked');} //descriptionText:'click here to reset your password' }); var formpanel = new Ext.FormPanel({ labelAlign: 'top', frame:true, title: 'Multi Column, Nested Layouts and Anchoring', bodyStyle:'padding:5px 5px 0', width: 600, height:80, region:'north', items: [{ layout:'column', items:[{ columnWidth:.8, layout: 'form', items: [{ xtype:'textfield', fieldLabel: 'Identification', name: 'transID', anchor:'80%' }] },{ columnWidth:.2, layout: 'form', items: [formbtn] }] } ] // bbar:tb });
-
15 Jan 2008 11:38 PM #7
-
16 Jan 2008 12:40 PM #8
From Docs:
labelSeparator : String
The standard separator to display after the text of each form label (defaults to the value of Ext.layout.FormLayout.l...
The standard separator to display after the text of each form label (defaults to the value of Ext.layout.FormLayout.labelSeparator, which is a colon ':' by default). To display no separator for this field's label specify empty string ''.
-
16 Jan 2008 6:08 PM #9Sencha - Sales Team
- Join Date
- Mar 2007
- Location
- Melbourne, Australia (aka GMT+10)
- Posts
- 738
- Vote Rating
- 6
can you please add a screenshot or demo to your post, thanks :-)
-
19 Jan 2008 3:56 PM #10dddu88Guest
Lev_A,
Thanks very much, your approach to set labelSeparator : '' really works, the button is lined up with the TextField very well, the only thing is the distance between the TextField and Button is a little far away, I used anchor:'80%' for the Field and 20% for the button, it seems like the button is put in the center of the column, is there a way to put the button to the most left of the column?
Thanks in advance.


Reply With Quote




