PDA

View Full Version : auto estimate labelWidth



bhomass
8 Nov 2009, 6:35 PM
I like to be able to automatically determine the min div width which will fully contain the label characters for a field, instead of having to manually assign a constant width.

has any one attempted that? or is this way too difficult to bother with?

Animal
9 Nov 2009, 12:28 AM
Pretty easy. Use DomQuery to gather them up, then TextMetrics to find the max width.

There, that's how to do it. Give it some thought.

frif
9 Nov 2009, 1:01 AM
This is something I have in my TODO list as well. I'd like to extend FormPanel so that I don't have to manually set labelWidth anymore.

please share your progress.

Thanks
frif

Animal
9 Nov 2009, 1:04 AM
I'd like to extend FormPanel so that I don't have to manually set labelWidth anymore.

Go ahead!