View Full Version : what should I use...basic text field as alternative to form/label[SOLVED]

26 May 2010, 7:07 AM
I apologize for this being obvious to many of your, but I've struggled with this on several occasions and could really use some advice. I could do straight html for this, but I want Ext to control layout/alignment...I want to know the Ext way of solving this.

I need to use a container as a simple label. I'm not sure if I should use a text field with the right config, or a container, or some other type I am not aware of. I need it to align with a dynamically resizing group of input fields (NOT a form, I am using a column layout nested inside a vbox layout to manage a group of inputs, I am looking to put labels in a column layout within the vbox...as a header row with the same dynamic behavior as the input rows.
I do not want borders, and I do want the background to inherit from the parent containers.

It seems so simple, yet when I use basic containers, I can't seem to get the text to display, and when I use a textfield, I am getting all these extra features that I am going to have to disable one by one. I feel like I am missing something and am hoping somebody can point me in the right direction....


26 May 2010, 7:18 AM
Use a simple BoxComponent, e.g.

{xtype: 'box', autoEl: {cn: 'Some html'}}

26 May 2010, 7:37 AM
lifesaver! thanks!

One minor problem remains. Not all of these have text, some are spacers. The spacers are correctly being used as inputs to the column width calculations of dynamic elements, but they are not causing the next column to be shifted by that amount. When I inspect the generated html, the div is there with the correct width, it just does not cause the intended positioning of elements farther to the right.

26 May 2010, 7:41 AM
Did you set the spacer to:

{xtype: 'box', autoEl: {cn: ' '}}

26 May 2010, 10:22 AM
perfect: I should have thought of that.

Thanks for all your help [SOLVED]