Hybrid View

  1. #1
    Sencha User PhiLho's Avatar
    Join Date
    Nov 2011
    Location
    Near Paris, France
    Posts
    140
    Vote Rating
    1
    PhiLho is on a distinguished road

      0  

    Default Beta3: VerticalLayoutContainer doesn't resize properly a Grid

    Beta3: VerticalLayoutContainer doesn't resize properly a Grid


    Context: we have a prototype whose global layout is made of a Viewport enclosing a BorderLayoutContainer.
    In the center area, we put a ContentPanel, which we clear and where we add a widget, depending on selections in the tree on the west side.

    First point: The widget we put is a grid inside a FramedPanel. It seems we cannot add a grid via UiBinder. I see no example in the Explorer Demo, and if I add <gxt:grid.Grid ui:field="grid"/> then declare it as UiField(provided=true) Grid<Data> grid; and fill after the createAndBindUi, I get only empty divs. Looks similar to my issue with filling a UiBinder-declared combo box with RPC I reported earlier.
    When adding the grid manually after the UI binding, the first time there is a glitch: the body of the grid goes way beyond the bottom of the browser screen, as if no height was defined. Upon resizing the browser, the body is correctly sized and the scrollbar appears. If I go to another grid, it is correctly resized the first time (not if I resized the browser while the grid wasn't displayed, then I display the grid...). So it is mostly okay.

    Second point: in another view, we put in the content panel a FramedPanel containing a VerticalLayoutContainer (VLC) because we need a ButtonBar above the grid.
    We have to add the grid manually here too, to the VLC, after the ButtonBar.
    Here again, the grid has no scroll bar and is way too tall.
    Using Firebug, I can see it is the div of class x-grid3-scroller has a defined width (set to the width of the FramedPanel, but which isn't adjusted when resizing) but no defined height, hence the lack of scrollbars.

    I don't know how to workaround this: I can set a height, but it is browser / environment dependent, so it will be ugly. Is there a way to propagate resizing beyond a VLC? Viewport is used only on the whole browser area, not on a div.

    I hoped that Beta3 fixed this problem, but no luck.

  2. #2
    Sencha User
    Join Date
    Sep 2007
    Posts
    13,971
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    Can you please provide standalone testcases implementing EntryPoint for both of your issues?

  3. #3
    Sencha User PhiLho's Avatar
    Join Date
    Nov 2011
    Location
    Near Paris, France
    Posts
    140
    Vote Rating
    1
    PhiLho is on a distinguished road

      0  

    Default


    I found another thread on the topic, and another. Let's say that's an update for Beta3, and a remark on the UiBinder of Grid.
    Beside, I don't understand the given solution. What is this @Detail annotation? Where is it documented? What are these fields? Are they all needed? Is there a way to set this fit parameter without the annotation?

    The thread mentions a FitLayout class and a Page class, and I see none in GXT 3.

    I just saw your message, Sven, I will try and find time to make a minimal project, if still needed.

  4. #4
    Sencha User
    Join Date
    Sep 2007
    Posts
    13,971
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    The Detail annotation is just part of the example application and should not be relavant for your code.

  5. #5
    Sencha User PhiLho's Avatar
    Join Date
    Nov 2011
    Location
    Near Paris, France
    Posts
    140
    Vote Rating
    1
    PhiLho is on a distinguished road

      0  

    Default


    It was the feeling I had, that's why I was puzzled to see you mentioned to use it to fix the problem, unless I just misunderstood everything.

    I would gladly retract the "bug" claim if there is just a trick that I would have overlooked to make children to fill their parent.
    [EDIT] I just noticed I failed to put the thread in the bug section. Not a problem...

    BTW, thanks for your answers. Still looking to find time to make this small test case.

  6. #6
    Sencha User
    Join Date
    Sep 2007
    Posts
    13,971
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    I would gladly retract the "bug" claim if there is just a trick that I would have overlooked to make children to fill their parent.
    GXT layouts work the other way round. The parent sizes the children.
    The only way to help you is that you would need to provide a testcase implementing EntryPoint that shows your problem. If your grid does not get sized, than there is highly probably an issue in your layoutcode.

  7. #7
    Sencha User
    Join Date
    Sep 2007
    Posts
    13,971
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    Without knowing any line of your code and just guessing:

    1) Are you calling forcelayout after adding the grid?

    2) What is the VerticalLayoutData you are using for the grid? Do you specify one at all?