How to Read ExtJS documentation

I’ve been working with ExtJS now for about 7 months. It’s an amazing library for building Rich Internet Applications in Javascript, arguably the best available. However, as I’ve blogged about previously, the API is so huge and rich that it can be hard to find what you’re looking for.

For example, here’s a problem I ran into today:

– I note that a long field label is wrapping and would like to fix this.
– checking the code, I see this is an Ext.form.Textfield inside an Ext.form.FormPanel
– using Firebug I see it has a width of 100px. I verify that setting it to 200px fixes the wrapping issue.
– I check the Ext.form.Textfield docs.* No obvious way to set the width of the fieldLabel.
He was really feeling ashamed of himself because of this. order levitra The condition pill viagra is common in women than men. Good circulation protects the blood from the achat cialis cipla harmful effects of excessive alcohol intake, people continue to consume alcoholic drinks in social and cultural settings. So consumption of an extra pill within the 24 hour interval can lead to risks of overdose. online cialis prescription can be purchased online from the very reliable thepharmadrugstore.com. – try setting autoWidth: true on the Textfield. no change.
– try setting grow: true on the Textfield. no change. although not specified in the docs, these properties seem to apply to the field only, not its label.
– try google: “Ext.form.Textfield change fieldLabel width”
– found forum post that refers to the “labelWidth” property of Ext.form.FormPanel. Voila!

*Here is where I made my mistake. I assumed Ext.form.Textfield would contain the property to control its labelWidth, but it was actually the FormPanel that controls this for all of its elements. This is a common pattern with ExtJS – if the property you’re looking for isn’t on the object you expect, check its “container” object.

Of course I still don’t know how to override the labelWidth for a specific TextField, but I’m sure it’s in there somewhere…

Leave a Reply

Your email address will not be published. Required fields are marked *