PDA

View Full Version : TextArea growMin is not working properly



KingWarin
13 Feb 2013, 12:32 AM
Hi everyone,

I got a rather small problem, but I can't figure out a solution.

I got a TextArea (Ext.form.field.TextArea) that should be displayed like a TextField (single line) when it's empty and if text is entered the textArea should be able to grow to the height of 3 lines, so here is the code of my textArea:
Ext.create('Ext.form.field.TextArea', {
name:'subject',
grow:true,
growMin:25,
growMax:55,
fieldLabel:'Subject',
labelAlign:'left',
flex:1
});

The growMax is working like expected, but no matter what value I set to growMin, the textArea always has a height of at least 30px.

Does anybody know why I get this behaviour and how to change it so it'll work properly?

THX

Sven

sword-it
13 Feb 2013, 4:00 AM
Hi KingWarin,

Try the following code, it work fine for me -



Ext.create('Ext.form.FormPanel', {
title : 'Sample TextArea',
width : 400,
bodyPadding: 10,
renderTo : Ext.getBody(),
items: [{
xtype : 'textareafield',
grow : true,
name : 'message',
fieldLabel: 'Message',
growMax : 200,
growMin: Ext.isSafari ? 16 : 22,
growPad: Ext.isSafari ? -14 : -8,
growAppend: ''
}]
});

also read this thread- http://www.sencha.com/forum/showthread.php?24606-FIXED-2.0.1-TextArea-grows-unproportionally-in-IE

KingWarin
13 Feb 2013, 5:11 AM
Thanks, that made the cut!

Essentially it was just about the growAppend if it's set to '' it works fine!


Hi KingWarin,

Try the following code, it work fine for me -



Ext.create('Ext.form.FormPanel', {
title : 'Sample TextArea',
width : 400,
bodyPadding: 10,
renderTo : Ext.getBody(),
items: [{
xtype : 'textareafield',
grow : true,
name : 'message',
fieldLabel: 'Message',
growMax : 200,
growMin: Ext.isSafari ? 16 : 22,
growPad: Ext.isSafari ? -14 : -8,
growAppend: ''
}]
});

also read this thread- http://www.sencha.com/forum/showthread.php?24606-FIXED-2.0.1-TextArea-grows-unproportionally-in-IE