1. #1
    Sencha User
    Join Date
    Jun 2012
    Posts
    82
    Answers
    7
    Vote Rating
    1
    dr-dan is on a distinguished road

      0  

    Default Answered: Hbox layout not resizing on browser resize

    Answered: Hbox layout not resizing on browser resize


    I have a content panel centered, with two panels either side acting as padding each with unique background repeat (this is why i havent used a trad. margin: auto}:

    Flexer.png

    The panels render fine, but they do not "flex" as expected when i resize the browser window. They stay as they are. The parent is a Container. When the parent is a Viewport is works ok but then the columns stretch to fill the full height of the browser, not the 400 minheight specfied...

    Have I got a round hole and a square peg?

    Code:
     Ext.define('Pegfect.view.Viewport', {  extend: 'Ext.container.Container',
     
      renderTo: Ext.getBody(),
      layout: { type: 'hbox', pack: 'center', align: 'stretch' },
      minHeight: 400,
      defaults: { minHeight: 400 },
      items: [{
        flex: 1,
        style: { backgroundColor: '#023a60' }
      }, {
          width: 568
      }, {
        flex: 1,
        style: { backgroundColor: '#ffffff' }
      }]
    });

  2. Turns out it was just a case of telling the container to doLayout on window resize:

    Code:
    launch: function () {
        var vp = Ext.create('Pegfect.view.Container', {
          renderTo: document.body
        });
        Ext.EventManager.onWindowResize(vp.doLayout, vp);
      }

  3. #2
    Sencha User
    Join Date
    Jun 2012
    Posts
    82
    Answers
    7
    Vote Rating
    1
    dr-dan is on a distinguished road

      1  

    Default


    Turns out it was just a case of telling the container to doLayout on window resize:

    Code:
    launch: function () {
        var vp = Ext.create('Pegfect.view.Container', {
          renderTo: document.body
        });
        Ext.EventManager.onWindowResize(vp.doLayout, vp);
      }

Tags for this Thread

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar