1. #1
    Sencha User
    Join Date
    Dec 2010
    Posts
    47
    Vote Rating
    1
    eddow is on a distinguished road

      0  

    Default Complex layout calculation

    Complex layout calculation


    Hello,


    I use to have complex layouts and I unfortunately found a case where the layouts stop being calculated. Of course, I over-simplified the example.


    Code:
    Ext.require(['*']);
    Ext.onReady(function() {
        viewport = Ext.create('Ext.Viewport', {
            layout: {
                type: 'hbox',
                align: 'middle'
            },
            items: [{
                //width: 150,
                layout : {
                    type: 'vbox',
                    align: 'stretch'
                }, 
                items: [{
                    layout: 'fit',
                     items: [{
                        xtype: 'displayfield',
                        fieldLabel: 'blah',
                        value: ':-)'
                    }] 
                }]
             }]
        });
    });

    It is enough to specify the width of the vbox (uncomment the "width:" line) or to un-wrap the layout-fit (commenting the lines in red) for the field to draw. In this state, the viewport remains desperately empty (drawn with a height of 0)

  2. #2
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    17,055
    Vote Rating
    659
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    In which browsers are you seeing this? Does it log an error "Layout run failed"?
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  3. #3
    Sencha User
    Join Date
    Dec 2010
    Posts
    47
    Vote Rating
    1
    eddow is on a distinguished road

      0  

    Default


    Chrome, ffox and IE - and no log message. (I didn't check logs in IE)

    Here is my HTML ... two simple c/p and you can give a try.

    HTML Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">    <title>My Example</title>    <link rel="stylesheet" type="text/css" href="../../resources/css/ext-all.css" />
        <!-- GC -->
        <script type="text/javascript" src="../../ext-all.js"></script>    <script type="text/javascript" src="my.js"></script></head><body></body></html>
    In ext/examples/my/my.(js|html)

    version 4.1.0RC3
    Build date: 2012-04-09 21:11:41 (689b0758837b782dcb0747ba1c4d8ba76344070d)

  4. #4
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    17,055
    Vote Rating
    659
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    I don't see any issue when I run it (see attached).
    Attached Images
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  5. #5
    Sencha User
    Join Date
    Dec 2010
    Posts
    47
    Vote Rating
    1
    eddow is on a distinguished road

      0  

    Default


    Weird weird weird weird.
    Are we using the same version?

  6. #6
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    17,055
    Vote Rating
    659
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    Ah, no. I was trying on 4.1.0 final.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  7. #7
    Sencha User
    Join Date
    Dec 2010
    Posts
    47
    Vote Rating
    1
    eddow is on a distinguished road

      0  

    Default


    Damn, I missed the release.... I run download it.
    Thanks again.

Thread Participants: 1