Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    ListGrid setIsGroup padding changes in January 2022

    I've been using (or abusing) setIsGroup(true) on a ListGrid in order to get a nice border and a title label that don't consume additional layout space and look consistent with other "isGroups" that I use elsewhere. This is how this looked as far as SmartGWT 13.1d-2022-01-09 (wacky background colors are for "debugging" only):
    Click image for larger version  Name:	listgrid-grouped_smartgwt-13.1d-20220109_lbl.jpg Views:	0 Size:	20.9 KB ID:	270272

    However, somewhere around 13.1d-2022-01-30 the Canvas.setGroupPadding() property has been introduced and its default value has been set to 10. This has affected my ListGrids and they look like this now:
    Click image for larger version  Name:	listgrid-grouped_smartgwt-13.1d-20220130_lbl.jpg Views:	0 Size:	28.7 KB ID:	270271
    There is a gap between the blue group box and the list grid.

    I've found the affecting change to SmartGWT only after a session of bisecting and trying various versions. I thought I can restore the original appearance by finding all my ListGrids that are setIsGroup(true) and only add setGroupPadding(0) to them and I'll be good. But unfortunately the result is not the same.

    In 13.1d-2022-01-15 (that's between the 2 previous versions) something extra was also changed with the group box paddings and now when I setGroupPadding(0), I get this:
    Click image for larger version  Name:	listgrid-grouped_smartgwt-13.1d-20220115_lbl.jpg Views:	0 Size:	26.7 KB ID:	270273
    There is a slight empty gap between the top border of the group box and the ListGrid's top header.

    This behavior is the same in 13.1d-2023-05-22, to which I have switched recently.

    Is there a way to restore the appearance of ListGrid.setIsGroup(true) from version 13.1d-2022-01-09?

    Code:
    import com.google.gwt.user.client.ui.RootPanel;
    import com.smartgwt.client.widgets.Canvas;
    import com.smartgwt.client.widgets.grid.ListGrid;
    import com.smartgwt.client.widgets.layout.HLayout;
    import com.smartgwt.client.widgets.layout.Layout;
    
    public class SmartGridWoes extends Canvas {
        public SmartGridWoes() {
            this.setBackgroundColor("#e0ffe0");
            this.setHeight100();
            this.setWidth100();
    
            Layout main = new HLayout();
    
            main.setBackgroundColor("cyan");
            main.setPadding(10);
            main.setMembersMargin(10);
    
            ListGrid grid1 = new ListGrid();
            grid1.setWidth(300);
            grid1.setHeight(200);
            main.addMember(grid1);
    
            ListGrid groupedGrid1 = new ListGrid();
            groupedGrid1.setWidth(300);
            groupedGrid1.setHeight(200);
            groupedGrid1.setIsGroup(true);
            groupedGrid1.setGroupTitle("Grouped grid");
            // Remove the default padding of 10, but not the gap
            // between the top border of the group box and the
            // list grid's header.
            groupedGrid1.setGroupPadding(0);
            main.addMember(groupedGrid1);
    
            addChild(main);
            RootPanel.get().add(this);
        }
    }
    Last edited by robikz; 5 Jun 2023, 01:31.

    #2
    That top-offset is calculated as half of the height of the group-label and is there so the label doesn't overlap the content - overlapping content is a pretty unusual requirement in a UI.

    However, we've added a new attribute, Canvas.leaveGroupLabelSpace - if you set this to false as well as setting groupPadding: 0, you'll get the group-title overlapping the content as you need.

    Please retest with a build dated June 3 or later.

    Comment

    Working...
    X