PDA

View Full Version : [OPEN] GXT4: HideMode.OFFSETS - not taking Margins into account?



Cloudgatherer
20 May 2016, 10:48 AM
Hi there,

I've been migrating an app from GXT 3.0.6 to GXT 4.0.1 (GWT 2.5->GWT2.8b1 as well). One of our pages uses a combination of tabs (TabPanel), VerticalLayoutContainers, FieldSets, and FieldLabels with mixed in data entry widgets (String input fields, etc).

This worked just fine under GXT 3 but moving to GXT 4 I found the layouts of the data widgets to be fairly off and a horizontal scrollbar where there was none before. After re-checking all the widgets to have HideMode.OFFSETS enabled as well as checking if any of our Appearances might be affecting this, I disabled the Margins around the various widgets I'm adding to space them out a bit. Doing so made the page render how I might expect... while I would prefer to have the spacing provided by the Margins, it seems to just not work correctly with HideMode.OFFSETS in GXT4.

Is this a bug, a change, or maybe a change in convention in GXT 4 I was not aware of? Any insight here would be helpful.

Thanks.

branflake2267
23 May 2016, 6:26 AM
This smells like a bug. Although I suspect it's with how the programmatic sizing containers are behaving. In some cases where no layout data is given, like using -1, -1 for a VLC could cause issues down stream. If I could see more of the code configuration I could provide more options. May I see some of the code?

Cloudgatherer
23 May 2016, 11:40 AM
Not sure how much code you'd really need... basically the following block is what I ended up changing to get it to lay out correctly:


VerticalLayoutContainer vlc = (VerticalLayoutContainer)parent;
VerticalLayoutData vlData = new VerticalLayoutData();
// Issue: https://www.sencha.com/forum/showthread.php?310993-GXT4-HideMode.OFFSETS-not-taking-Margins-into-account&p=1135547#post1135547
//vlData.setMargins(new Margins(getMarginWidth()));
vlc.add(child, vlData);

So I was just adding margins in GXT3 (which worked) but as you can see I've removed them for GXT 4 to get the layout looking "correct" (sans margins).

In particularly, a VLC inside a FieldSet was not being rendered correctly, the inner widgets within the VLC were not displayed in the FieldSet, they were cut off at the bottom. Removing the margins as above fixes the issue.

Cloudgatherer
26 May 2016, 11:07 AM
Is this considered a bug or is more information needed?

branflake2267
27 May 2016, 8:51 AM
We did tune the VLC layout in 3.x minor release and it did change some of the layouts. It sounds like you're seeing a difference b/c of that patch. From the sounds of it you have a workaround too. There isn't much I can do now because of the change except ask for a test case which I could use to submit to engineering. Or if you need help finding a way around something I can help look at that more. Nice job with providing details and working around the issue too.

Cloudgatherer
31 May 2016, 9:45 AM
My workaround was to turn off all Margins... which obviously has no effect on utility, however if my designer comes back to me and asks me to put them back, I literally can't, due to what I consider a GXT bug at this point. I'd at least like to see a bug filed on the issue.

branflake2267
1 Jun 2016, 8:06 AM
Good point, I've filed the issue with engineering. Thanks for reporting.