Results 1 to 2 of 2

Thread: layout hbox does not work in ST 2.1?

  1. #1
    Sencha User cntop@msn.com's Avatar
    Join Date
    Sep 2012
    Location
    Anhui, China
    Posts
    18
    Vote Rating
    0
      0  

    Default Answered: layout hbox does not work in ST 2.1?

    hey guys, i find some problem with layout:hbox. code below

    Code:
    var panel = Ext.create("Ext.Panel", {	layout: 'vbox',
    	items: [{
    		xtype: 'panel',
    		html: '111',
    		style: 'background-color:red;'
    	},
    	{
    		xtype: 'panel',
    		layout: 'hbox',
    		items: [{
    			xtype: 'panel',
    			html: '222',
    			style: 'background-color:green;'
    		},
    		{
    			xtype: 'panel',
    			html: '333',
    			style: 'background-color:blue;'
    		}]
    	}]
    });
    Ext.Viewport.add(panel);
    this code work in ST2.0, but in ST 2.1, these three panels layout vbox together.
    why?
    ???????????
    order, law, moral, natural

  2. You aren't giving the child items any size. Should use flex or width/height. Also, would recommend using this layout:

    Code:
    layout : {
        type  : 'vbox', //or 'hbox'
        align : 'stretch'
    }

  3. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,696
    Answers
    3944
    Vote Rating
    1279
      0  

    Default

    You aren't giving the child items any size. Should use flex or width/height. Also, would recommend using this layout:

    Code:
    layout : {
        type  : 'vbox', //or 'hbox'
        align : 'stretch'
    }
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •