Page 1 of 3 123 LastLast
Results 1 to 10 of 22

Thread: VerticalLayoutContainer does not calculates own height properly.

  1. #1
    Sencha Premium Member
    Join Date
    Feb 2011
    Posts
    10

    Default VerticalLayoutContainer does not calculates own height properly.

    VerticalLayoutContainer does not calculates own height properly if any margin specified. It seems that margins are not getting included into overall height.

    Code:
        public void onModuleLoad() {
            VerticalLayoutContainer parentContainer = new VerticalLayoutContainer();
            RootPanel.get().add(parentContainer);
            
            VerticalLayoutContainer childContainer = new VerticalLayoutContainer();
            parentContainer.add(childContainer);
            // To make the containers boundries visible
            childContainer.getElement().getStyle().setBackgroundColor("red");
            
            TextField firstName = new TextField();
            childContainer.add(new FieldLabel(firstName, "First Name"), new VerticalLayoutData(-1, -1, new Margins(6)));
            
            TextField lastName = new TextField();
            childContainer.add(new FieldLabel(lastName, "Last Name"), new VerticalLayoutData(-1, -1, new Margins(6)));
        }
    As you see contents are getting out of the container boundaries. This will make very hard to place something next/after to the container.

    Output:
    theproblem.jpg

  2. #2
    Sencha Premium Member
    Join Date
    Jul 2013
    Posts
    2

    Default

    Hi,

    This issue seems to appear when using margins in the VerticalLayoutData, which is indeed a big problem. I am currently trying to migrate a 3.0.5 app to 3.1.0 and more than half the application is now unusable due to that problem.

    Can we expect a quickfix for this one ?

  3. #3
    Sencha Premium Member
    Join Date
    Feb 2011
    Posts
    10

    Default

    I can confirm that the problem still exists in 3.1.0 release.

  4. #4
    Ext GWT Premium Member
    Join Date
    Jun 2010
    Location
    Kyrksterra, Norway
    Posts
    71

    Default

    I got the same problem after migrating from 3.1-beta to 3.1

  5. #5
    Ext GWT Premium Member
    Join Date
    Jun 2010
    Location
    Kyrksterra, Norway
    Posts
    71

    Default

    My problem was solved by moving from VerticalLayoutContainer to CssFloatLayoutContainer with a CssFloatData size parameter of 1

  6. #6
    Sencha Premium Member
    Join Date
    Feb 2011
    Posts
    10

    Default

    stigrv,
    Thank you for the solution,
    But use of CssFloatLayoutContainer not an easy option for us. Too many layouts needs to be altered

    Our product almost complete. We are using a nightly build of gxt 3.1.0 and we have switched from gxt 3.0.

    I need to be sure that there is no other options before making this decision.

    Thanks

  7. #7
    Sencha Sr Product Manager
    Join Date
    Jan 2012
    Location
    Arlington, WA
    Posts
    1,167

    Default

    We are looking into this and will get back with more shortly.

    Brandon

  8. #8
    Ext GWT Premium Member
    Join Date
    Jun 2010
    Location
    Kyrksterra, Norway
    Posts
    71

    Default

    Using CssFloatLayoutContainer only works if all elements should fill the full width. If any of the elements use margins horizontally, the width of their margins are deducted from the total width to calculate what width all elements should be given. I'm not sure about its intended use, but I don't think that's the way to do it.

  9. #9
    Sencha Premium Member
    Join Date
    Feb 2011
    Posts
    10

    Default

    Quote Originally Posted by stigrv View Post
    Using CssFloatLayoutContainer only works if all elements should fill the full width. If any of the elements use margins horizontally, the width of their margins are deducted from the total width to calculate what width all elements should be given. I'm not sure about its intended use, but I don't think that's the way to do it.
    I agree with you stigrv. In my opinion Margins are not supposed to be deducted from the widgets width.

    Actually we have paused transition to 3.1.0 because of this issue. We are waiting Brandon's reply. As he stated he will get back with more information.

  10. #10
    Sencha Sr Product Manager
    Join Date
    Jan 2012
    Location
    Arlington, WA
    Posts
    1,167

    Default

    Just a note, I've found a bug with the CssFloatLayoutContainer margins calculation seems to be doubling on the right, and this throws off how it may be calculating (EXTGWT-3707). I have escalated the issue. Although this only occurs when using margins for a css float layout container addition.

    Code:
    CssFloatLayoutContainer con = new CssFloatLayoutContainer();
    con.add(getRowWidget(1), new CssFloatData(1, new Margins(10))); // right margin broken
    con.add(getRowWidget(2), new CssFloatData(1, new Margins(0)));   // works good
    While the margin is broken, another container can be used to wrap and add margins around that.

    I will share Vertical Layout options in the next posts.


    ~ New GXT Guides ~
    http://docs.sencha.com/gxt/3.1/


    ~ Tips and Announcements Community ~
    https://plus.google.com/communities/...85143928405373

Page 1 of 3 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •