1. #1
    Ext User
    Join Date
    Mar 2010
    Vote Rating
    tr888 is on a distinguished road


    Default Slider inside HBox : centering and spacing issues

    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.

  2. #2
    Sencha - Desktop Packager Dev Team jarrednicholls's Avatar
    Join Date
    Mar 2007
    Frederick, MD
    Vote Rating
    jarrednicholls will become famous soon enough jarrednicholls will become famous soon enough



    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/

Thread Participants: 1