PDA

View Full Version : Default width of any field



gameboy87
18 Jul 2012, 2:06 AM
What is the default width of an item and how to set the width of a field....It is not working for me...grrrr...:(

Farish
18 Jul 2012, 2:18 AM
you can set the width using the width config by giving it a number (of pixels).

e.g.


width: 100

your problem could be with layout of the panel containing that field.

sword-it
18 Jul 2012, 2:22 AM
Hi!

you may give a field width by its 'width' config

Sample:-




{
xtype: 'textfield',
fieldLabel: 'Your name',
name: 'name',
width:200
}



For more info, check the API, sample is given below:-
http://docs.sencha.com/ext-js/4-1/#!/api/Ext.form.field.Text-cfg-width

friend
18 Jul 2012, 3:41 AM
Keep in mind that width is actually the total combined width of the input field and it's label, where the width of the label can be controlled separately via the labelWidth: <n> config option.

scottmartin
18 Jul 2012, 7:56 AM
Correct .. the fields are now hbox containers and the editor portion is calculated as a delta.

Scott.