PDA

View Full Version : TabPanel contains TreeGrid where column data is overflowing.



cgokey2
23 Sep 2014, 11:13 AM
How can I tell TabPanel to layout again, it is almost working, see comment below.

I've got a pretty simple TabPanel, each widget contains a BorderLayout, where the center widget of the
BorderLayout is a TreeGrid.

Each column contains text but the text is overflowing and spilling into other columns. IT CORRECTS ITSELF if I toggle to another tab and back and all looks good... I've tried a number of things to force it to layout again.

Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() {
public void execute() {
tabPanel.forceLayout();
tabPanel.getActiveWidget().forceLayout();
tabPanel.getActiveWidget().getGrid().forceLayout();
};
});



Nothing seems to work!

Any other suggestions to make this work? It works fine in Chrome and Firefox, this is just problematic in Safari.

Chris

Andreas Samjeske
23 Sep 2014, 11:48 PM
What kind of TabPanel are we talking about?

tabPanel.getActiveWidget().forceLayout();
tabPanel.getActiveWidget().getGrid().forceLayout();
This confuses me. There is no forceLayout() method on widget, neither there is getGrid().

Oh, and which GXT version are you using? I guess 3.1 since this is the 3.1 section of the forum. I am asking since there has been a bug in CardLayoutContainer, which is used by TabPanel, fixed in 3.1.

cgokey2
24 Sep 2014, 5:30 AM
I'm using gxt-3.1.1.jar and using com.sencha.gxt.widget.core.client.TabPanel, which correct does use CardLayoutContainer.

Sorry, I was sort of using pseudocode there to explain my issue, that probably confused matters more.

tabPanel.forceLayout() won't fix the issue.
tabPanel.getActiveWidget() cast returns a BorderLayoutContainer() subclass, so forcing layout on that doesn't work.
tabPanel.getActiveWidget().getGrid() returns the actually grid in the center widget of the BorderLayoutContainer, so calling forceLayout() on that doesn't have any effect either.

This only happens in Safari (7.1 I'm using) -- Firefox and Chrome work fine.

So one thing that DOES work in Safari is if I go to a different tab and then switch back, then the grid lays out correctly. So if I can figure out a way to call whatever is being called during that case, I should be good, which is why I tried calling forceLayout on each layer below.

Chris