Hybrid View

  1. #1
    Ext JS Premium Member
    Join Date
    Mar 2008
    Location
    Colorado Springs, CO
    Posts
    40
    Vote Rating
    0
    droesler is on a distinguished road

      0  

    Default ext 4.1.1 - hbox layout doesn't appear to see pack: 'center'

    ext 4.1.1 - hbox layout doesn't appear to see pack: 'center'


    I saw some discussion about this and it was CLOSED, but I'm having issues with this converting an ext 3.x app to 4.x.

    Below is the code for the north region in a Viewport layout. Everything works except pack: 'center'. Each of the items are at the left of their containers. Just to see what would happen I changed it to pack: 'right' and there was no difference. Am I missing something?

    Thanks

    Dennis

    Code:
    Ext.create('Ext.container.Container', {        // north region
       region: 'north',
       id: 'clientTitle',
       baseCls: 'x-plain',
       margins: '10 0 0 0',
       height: 65, // give north region a height
       layout: {
          type: 'hbox',
          pack: 'center',
          align: 'middle'
       },
       items: [
          {
             xtype: 'container',
             flex: .5,
             autoEl: {
                cls:  'image',
                tag: 'img',
                src: '/images/my_image.png'
             }
          },
          {
             xtype: 'container',
             flex: 2,
             id : 'myTitle',
             autoEl: {
                tag: 'div',
                cls: 'title',
                html:'My Title'
             }
          },
          {
             xtype: 'container',
             flex: .5,
             autoEl: {
                tag: 'div',
                cls: 'version',
                html: 'test'
             }
          }
       ]
    })

  2. #2
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,506
    Vote Rating
    54
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    They're all flexed, so all space is going to be used.

  3. #3
    Ext JS Premium Member
    Join Date
    Mar 2008
    Location
    Colorado Springs, CO
    Posts
    40
    Vote Rating
    0
    droesler is on a distinguished road

      0  

    Default


    The flex part is working as expected, but how do I get the values in each of the containers of the items property to align to the horizontal center of those containers?

Thread Participants: 1