PDA

View Full Version : AutoWidth for FormLayout LabelWidth



randy85253
May 04, 2009, 2:59 PM
Is there any way to have the FormLayout LabelWidth be automatically set to fit the size of the label text?

randy85253
May 04, 2009, 10:40 PM
The answer seems to be a big NO, at least not without doing some kind of plugin.

This is an issue raised alot on the ExtJs forums as well, citing the same issue I have which is that you don't always know what text is going to be used for the Label. i.e. Internationalization.

Here is one post that looks interesting: http://extjs.com/forum/showthread.php?t=25758

I don't suppose anyone has already done this???

Vladimir
May 05, 2009, 10:31 AM
Hi,

Yes, you are right.

At this moment the FormLayout does not support it.

It is need to change FormLayout (javascript) and use Ext.util.TextMetrics to determine label width (the using of TextMetrics you can see in this post http://forums.ext.net/showthread.php?2752#post11515)

geoffrey.mcgill
May 05, 2009, 3:06 PM
Hi Randy,

This is an expensive process to perform client-side and could/would affect rendering times. It would be much better to try and calculate an approximate width on the server and set the LabelWidth property.


We might be able to implement client-side calculation in a future release. I think it would be a handy feature to have, although it's going to take time to develop and test. 


I'm moving this thread to the Feature Requests forums so we can better track the request.