1. #1
    Sencha User
    Join Date
    Jan 2013
    Posts
    2
    Vote Rating
    0
    clfh is on a distinguished road

      0  

    Default Unanswered: GXT Layouts initially wrong and not responding to browser re-size

    Unanswered: GXT Layouts initially wrong and not responding to browser re-size


    I've found that none of the Sencha layouts are working correctly for me. The layout on initial page open is roughly correct, but nothing responds to changes in browser size.

    As a simple test I've constructed a new Eclipse project (zztest) which just opens the Sencha CenterLayoutExample class. This works fine when viewing it as part of the overall Sencha demonstration (running from a web server on my own machine).

    But in this simple test the CenterLayout widget opens up displayed in the horizontal center, but near the top. There is no response to browser re-size.

    Watching with Firebug, no positions are changed on any of the elements as the browser size is changed (On the Sencha example the positioning values are re-calculated as the browser changes size).

    It appears as if the browser.resize() event is not being passed to the layout system.

    In brief my configuration is:
    GWT 2.5
    Sencha- gxt-3.0.1
    Host page starts with: <!DOCTYPE html>
    Inherits in xxtest.gwt.xmk: <inherits name='com.google.gwt.user.User'/>
    <inherits name='com.google.gwt.user.theme.clean.Clean'/>
    <inherits name='com.sencha.gxt.ui.GXT'/>
    The file war/zztest/reset.css is in place.

    The gxt-3.0.1.jar is referenced both from the Java Build Path and the launch configuration.

    I am not using Maven.

    Can anyone see anything missing / wrong?

    TIA
    Chris

  2. #2
    Sencha User
    Join Date
    Jan 2013
    Posts
    2
    Vote Rating
    0
    clfh is on a distinguished road

      0  

    Default


    I solved my own problem.

    The set-up was OK.

    I needed to wrap the CenterLayoutExample in a Viewport. That responds to the browser re-size events.

  3. #3
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,717
    Answers
    109
    Vote Rating
    89
    Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light

      0  

    Default


    This is correct - wrapping the root layout in a Viewport will ensure that this root always knows how much space it has to work with within the browser. For this reason, you should never have more than one viewport (they will each take all of the available space).

    All of the demos at sencha.com/examples implement entrypoint, but they are shown by implementing IsWidget, not by calling that onModuleLoad method. Most of them work just fine when added directly to the page as they have a specific size already, but some should have a Viewport, including the CenterLayoutExample. I'll look into updating the examples to ensure that their layout always runs correctly when set up as a standalone example.

Thread Participants: 1

Tags for this Thread