-
11 Oct 2011 11:44 AM #1
Answered: ExtJS: Why isn't autosize working for my textfields?
Answered: ExtJS: Why isn't autosize working for my textfields?
I have a FormPanel (Ext.form.Panel) with text fields; I'd like the text fields to automatically resize so that their entire contents are visible, but the following isn't working:
Both of my event handlers fire. However, autosize only fires when the form is rendered; not when I try to manually call autoSize().Code:Ext.define('myapp.view.admin.EditUserFormPanel', { extend: 'Ext.form.Panel', initComponent: function() { var me = this; me.items = [ { xtype: 'textfield', fieldLabel: 'OpenID', name: 'openid', grow: true, listeners: { autosize: function(newWidth) { console.log(newWidth); }, focus: function(txtField) { console.log('focus fired'); txtField.autoSize(); } } } ]; me.callParent(); } });
Any ideas?
-
Best Answer Posted by charris
Changing the layout to something other than the default 'anchor' solved the problem. Example:
Attachment 28618
I have an example on JSFiddle that anyone can try running/modifying if they have a similar problem and want to see how this works: http://jsfiddle.net/clint_harris/5wzjG/
-
11 Oct 2011 2:29 PM #2
Answer
Answer
Changing the layout to something other than the default 'anchor' solved the problem. Example:
ZJiRz.jpg
I have an example on JSFiddle that anyone can try running/modifying if they have a similar problem and want to see how this works: http://jsfiddle.net/clint_harris/5wzjG/


Reply With Quote