You found a bug! We've classified it as EXTGWT-2643 . We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #1
    Sencha User
    Join Date
    Mar 2012
    Posts
    13
    Vote Rating
    0
    igieon is on a distinguished road

      0  

    Default FieldSet and VerticalLayout with height="1" invalid height calculation in doLayout()

    FieldSet and VerticalLayout with height="1" invalid height calculation in doLayout()


    FieldSet has style with margin, but when VerticalLayout compute layout use only margin from LayoutData.

    For example if you use fieldset with height="1" thats is bug.

    Workaround for proper function is use marging with same bottom margin as style in FieldSet style.

    GXT version 3.0.1

  2. #2
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,732
    Vote Rating
    90
    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


    Can you provide a complete test case, following the template posted? I'm not sure I am understanding the issue you are describing.

  3. #3
    Sencha User
    Join Date
    Mar 2012
    Posts
    13
    Vote Rating
    0
    igieon is on a distinguished road

      0  

    Default


    Added example code Bug.java derived from GridBindingExample.

    Added printscreen when in example modifing Maring 0,10,20.


    Attached Images
    Attached Files

  4. #4
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,732
    Vote Rating
    90
    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


    There is no Bug.java in your example zip. No class even uses the Grid class, so I'm not sure what I'm supposed to be looking at.

    From your screenshots though, combined with the , this makes sense as being correct. Assuming you've added the initial FieldSet with new VerticalLayoutData(1, -1) (all width, only the height that is required), you've added the grid with VerticalLayoutData(1,1) (i.e. consume all remaining height and width), and you've explicitly assigned a size for the entire panel, the layout engine has no choice but to do what it has done.

    You've give only X pixels to work with for the height. First, handle the fieldset - subtract out the margin M, and the fieldset height, Fh. This leaves you with X - 2M - Fh pixels remaining for the grid and its margin. The same margin again is used, so the grid's height (Gh) only gets Gh = X - 4M - Fh, and clearly as M grows, Gh must shrink, since X and Fh are constants.

    If my assumptions are flawed, then I need a real test case - I can only work with what you give me. In the future, please follow the bug template from your very first post - we have this for a reason.

  5. #5
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,732
    Vote Rating
    90
    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


    My apologies - you did attach the correct zip, but I say the name (client.zip) and the file in my downloads folder (client.zip), and assumed these were the same things. In fact, your zip was downloaded as client(1).zip, which I failed to notice. That said, please do start with code in your first post so we don't need ask each time.

    From reviewing the code, Bug.java has no margins, while BugOk.java has 10px margins - isn't this the reverse of what you intended?

    The structure appears to be exactly what I had posted in my last message, which is the correct behavior for this components, based on the space allocated, and the size of the margins - where else could that grid get space to draw if you want 10px above and below both fieldsets, and yet only 300px to fit the whole thing in?

    And finally, a suggestion: both VerticalLCs c1 and c2 are unnecessary - instead, add the grid/stockeditor to their FieldSets directly. By default, FieldSet already resizes its children to the available space - it inherits this from SimpleContainer (and if it didn't, it would fail to size the VLC correctly anyway). Removing these won't make a large difference in render/resize times, but you'll gain benefits between many small improvements and easier to read code.

  6. #6
    Sencha User
    Join Date
    Mar 2012
    Posts
    13
    Vote Rating
    0
    igieon is on a distinguished road

      0  

    Default


    I need Vertical container in fieldset because i have more fields in fieldset. I use ui:binder in project. Here is slightly modified example where is problem.
    On printscreen when i use fieldset without margin layout is wrong. If i replace fieldset with framed panel layout is ok.
    I think that is bug.
    Attached Images
    Attached Files

  7. #7
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,732
    Vote Rating
    90
    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


    From your initial descriptions, I had apparently thought you were describing the height of the children, not the containers.

    com/sencha/gxt/theme/base/client/field/FieldSet.css adds 10 px to the bottom of the FieldSet area - as you've noted, it appears that the VerticalLC isn't taking this into account. Apparently, GWT's UiObject is incorrectly documented:
    Code:
      /**
       * Gets the object's offset height in pixels. This is the total height of the
       * object, including decorations such as border, margin, and padding.
       * 
       * @return the object's offset height
       */
      public int getOffsetHeight() {
    While https://developer.mozilla.org/en-US/...ns_of_elements states that this value does *not* include margins - as your bug notes.

    In your screenshots, I see both the right and bottom lines missing, but when I run this, I see only the bottom missing. I suspect this is due to your bug.html file missing. As you've only described the bottom issue, I'm assuming this is an artifact of your sample, and not something else you are reporting.

    You should not use VerticalLayoutContainer to hold all unsized (i.e. no VerticalLayoutData or -1 values) children - it makes no sense to use VLC without at least one size being given a size. It will probably work, but is overkill, as extra sizing checks are being made that you don't need. Consider CssFloatLC instead. This doesn't seem related to the bug though.

    I've filed this as an issue, and we'll follow up here when a fix is ready. In the meantime, two workaround seem clear:
    * Replace the FieldSet appearance to remove the 10px bottom margin
    * Use a Margins object - to minimize the effect of the this, consider using the constructor that takes 4 ints. You should only need to set this on the item added with a -1 height:

    Code:
                    c.add(fs1, new VerticalLayoutData(1, -1, new Margins(0,0, margin, 0)));

Thread Participants: 1