1. #1
    Sencha Premium Member
    Join Date
    Sep 2011
    Posts
    48
    Vote Rating
    1
    stahlman is on a distinguished road

      0  

    Default User-triggered window resize required to force correct layout of container hierarchy

    User-triggered window resize required to force correct layout of container hierarchy


    I've noticed a number of scenarios in which a view comes up initially blank - or if not completely blank, with much of its content missing. The display is fixed the first time I resize the window. I haven't debugged in detail, but it appears that in such cases, the width and/or height properties of parent containers aren't getting set during the initial layout, with the result that overflowing child components are hidden.

  2. #2
    Sencha - Ext JS Dev Team dongryphon's Avatar
    Join Date
    Jul 2009
    Posts
    1,341
    Vote Rating
    132
    dongryphon is a name known to all dongryphon is a name known to all dongryphon is a name known to all dongryphon is a name known to all dongryphon is a name known to all dongryphon is a name known to all

      0  

    Default


    I haven't seen that behavior before, but your guess as to the root cause certainly fits the symptoms. Any chance that can be reproduced in a small example?
    Don Griffin
    Ext JS Development Team Lead

    Check the docs. Learn how to (properly) report a framework issue and a Sencha Cmd issue

    "Use the source, Luke!"

  3. #3
    Sencha Premium Member
    Join Date
    Sep 2011
    Posts
    48
    Vote Rating
    1
    stahlman is on a distinguished road

      0  

    Default


    Although it happens on a number of screens, the application is large and complex, and I haven't yet been able to isolate a small test case. Will post if I do...

    This may be unrelated, but I also get a number of exceptions from the following line in Ext.layout.component.Component.beginLayoutCycle:
    Code:
    ownerContext.setWidth(me.lastComponentSize.width, false, true);
    The problem is that me.lastComponentSize is undefined the first time this method is called for the component (firstCycle == true). I haven't really investigated to see how this property is supposed to be "bootstrapped", but apparently, it doesn't happen the way it should in some cases...

    Thanks,
    Brett S.

  4. #4
    Sencha - Ext JS Dev Team dongryphon's Avatar
    Join Date
    Jul 2009
    Posts
    1,341
    Vote Rating
    132
    dongryphon is a name known to all dongryphon is a name known to all dongryphon is a name known to all dongryphon is a name known to all dongryphon is a name known to all dongryphon is a name known to all

      0  

    Default


    The root cause of this exception is improper "scoping" of the layout. While it is tempting to add a null check and default in some values, that will just produce a garbage layout result...

    <tmi>
    When a component is told to layout, if a dimension is calculated by its ownerLayout (width/heightAuthority==2), but the ownerLayout is not in scope for this run ("isTopLevel") then we pull the size information from the last layout run ("lastComponentSize"). If the component has never been sized, it will not have a "lastComponentSize" and so the layout scope *must* include its ownerLayout... sadly if "lastComponentSize" is null in this case, then this requirement is being violated.
    </tmi>


    Thanks for digging in on the build - much appreciated.
    Don Griffin
    Ext JS Development Team Lead

    Check the docs. Learn how to (properly) report a framework issue and a Sencha Cmd issue

    "Use the source, Luke!"

  5. #5
    Sencha Premium Member
    Join Date
    Sep 2011
    Posts
    48
    Vote Rating
    1
    stahlman is on a distinguished road

      0  

    Default


    Don,
    Thanks. I appreciate the explanation.
    Brett S.

  6. #6
    Touch Premium Member
    Join Date
    Jun 2011
    Posts
    474
    Vote Rating
    1
    johnnywengluu is on a distinguished road

      0  

    Default


    I am getting the error "me.lastComponentSize is undefined" in FireFox and "TypeError: Cannot convert 'me.lastComponentSize' to object" in Opera.

    It works great in Safari and Chrome.

    Will this be fixed for the next release?

  7. #7
    Sencha - Ext JS Dev Team dongryphon's Avatar
    Join Date
    Jul 2009
    Posts
    1,341
    Vote Rating
    132
    dongryphon is a name known to all dongryphon is a name known to all dongryphon is a name known to all dongryphon is a name known to all dongryphon is a name known to all dongryphon is a name known to all

      0  

    Default


    Quote Originally Posted by johnnywengluu View Post
    I am getting the error "me.lastComponentSize is undefined" in FireFox and "TypeError: Cannot convert 'me.lastComponentSize' to object" in Opera.

    It works great in Safari and Chrome.

    Will this be fixed for the next release?
    This is much improved for the next release, yes.
    Don Griffin
    Ext JS Development Team Lead

    Check the docs. Learn how to (properly) report a framework issue and a Sencha Cmd issue

    "Use the source, Luke!"

Thread Participants: 2