View Full Version : How to size textarea to max

30 Dec 2011, 3:59 PM
I added 2 panels (side by side). The panel on the left contains 3 textboxes stacked vertically. The panel on the right contains a single text area with a label align of top so that the label is on top of the text area but the text area box is small. I want it to have a width of 100% but you can't specify % and I don't want to hard code the width. I just want it to be as wide as the parent container. Oh, and I am doing this with the designer. Working on the layouts from code examples was not working out for me so well.


30 Dec 2011, 6:20 PM
You may use anchor config option

like this anchor : '100%' . Use on textArea field ,This option will increase or decrease size of text area depending container width

This may help you..Thank you

2 Jan 2012, 1:10 PM
I do not see an anchor property for the text area control or the container of the text area control. Where do I find that setting?

2 Jan 2012, 11:07 PM
anchor config applicaple for all childitem of container
so you can use anchor in textarea
check this url
This will take to understand

4 Jan 2012, 11:50 AM
Try something like this:

layout: {type: 'hbox', align: 'stretch'},
padding: 7, border: false, width: 250,
defaults: {labelAlign: 'right', labelWidth: 50},
items: [
{ xtype: 'textfield', fieldlabel: 'Name' },
{ xtype: 'textfield', fieldlabel: 'Address' },
{ xtype: 'textfield', fieldlabel: 'Email' }
xtype: 'textareafield',
fieldLabel: 'Comments',
labelAlign: 'top',
flex: 1