1. #1
    Sencha User
    Join Date
    Feb 2011
    Posts
    3
    Vote Rating
    0
    udeleng is on a distinguished road

      0  

    Default VerticalLayoutContainer child containers extend under scrollbar

    VerticalLayoutContainer child containers extend under scrollbar


    I'm using GXT 3.0.1 with GWT 2.5.1.

    I want a layout that contains multiple GXT grids. When the children grids force a scroll bar to appear on the VL container, part of the grid appears under the scroll bar, in particular, the tools menu for the right most column. The grids must resize when the window is resized.

    As a test code, instead of grids, I added two children with fixed height, containing a right aligned label. In the browser, part of the label appears under the scroll bar. I tried using adjustforScroll attribute on VLC, but then the child contains are always spaced away from the right edge, even when there is no scroll bar.

    Here is my test code:

    Code:
    <ui:withtype="com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer.VerticalLayoutData" field="gridLayoutData">
        <ui:attributeswidth="1" height="300" />
    </ui:with>
    
    <container:VerticalLayoutContainer ui:field="container" scrollMode="AUTO">
        <container:child layoutData="{gridLayoutData}">
            <container:SimpleContainer addStyleNames="{style.label}">
                <g:Label text="TEST1" />
            </container:SimpleContainer>
        </container:child>
        <container:child layoutData="{gridLayoutData}">
            <container:SimpleContainer addStyleNames="{style.label}">
                <g:Label text="TEST2" />
            </container:SimpleContainer>
        </container:child>
    </container:VerticalLayoutContainer>
    

  2. #2
    Sencha User
    Join Date
    Feb 2011
    Posts
    3
    Vote Rating
    0
    udeleng is on a distinguished road

      0  

    Default


    My solution so far been as follows:


    Code:
    verticalLayoutContainer.addResizeHandler(new ResizeHandler() {
      @Override
      public void onResize(ResizeEvent event) {
        final boolean hasScroll = verticalLayoutContainer.getScrollSupport().getMaximumVerticalScrollPosition() > 0;
        verticalLayoutContainer.setAdjustForScroll(hasScroll);
        verticalLayoutContainer.forceLayout();  
      }
    });

Tags for this Thread