View Full Version : Slider inside HBox : centering and spacing issues

8 May 2010, 9:56 AM
I am going to assume that a Slider cannot go inside a CompositeField because the Designer won't let it happen.
So I'm putting one, along with two other components, inside an HBox. I want them to be centered with a little space between each:

{abcDisplayField} {Number Field} {Slider}

I've wrapped the HBox in a container and am applying CSS to the wrapper to center its contents. When the contents are centered, they're shifted to the left, as if the centering algorithm were working with a slider width that is much greater than it actually is.


How do I get these fields properly centered in their HBox and also put a little space between the components?

Thanks for the help.

8 May 2010, 7:50 PM
Please see the "flex" (for sizing) and "pack" (for centering) layout options for HBox in the documentation. Setting "pack" to "center" will center your items in the HBox layout. You can then apply a "margins" configuration to space out your items.

For further questions regarding the Ext JS library, you can post on the Ext JS forums and also see the Ext JS documentation at http://www.extjs.com/deploy/dev/docs/