PDA

View Full Version : Autosize TextField depending on contents?



venomizer
19 Aug 2009, 7:07 AM
Is it possible to make a TextField autosize itself depending on the length of the text inside it?

I can think of a long winded way where I set up a listener for the change event of the field which counts the number of characters in the field and sets the width accordingly. The config autoWidth sounds like it should do what I am wanting to do, but regardless of what is put in the field, it will stay the same width.

Does autoWidth only work on a refresh of the field? At the moment, my fields are in a FormPanel which is rendered on page load, but collapsed in the south region of my viewport until required, at which point it is expanded and the fields are populated.

Lukman
19 Aug 2009, 11:10 PM
grow: true

venomizer
20 Aug 2009, 12:07 AM
Thanks, that works :)