PDA

View Full Version : TabPanel with FitLayout



franck971
21 Aug 2009, 4:52 AM
Hi,
(I'm new to GXT.)

I want to have something like an autoresize TabPanel (a TabPanel with a % witdh)
So I tried to put it in a LayoutContainer with a FitLayout but the result isn't good

I tried to play with several option of the container or the tabpanel but no way..

I've looked in the forums, this subject is often discussed but I did'nt find a trivial solution.

Can you tell me how to modify the following code?

Franck


tabPanel = new TabPanel();
tabPanel.setAutoWidth(true);
tabPanel.setMinTabWidth(115);
tabPanel.setResizeTabs(true);
tabPanel.setAnimScroll(true);
tabPanel.setTabScroll(true);
tabPanel.setCloseContextMenu(true);
while (index < 7) {
addTab();
}
tabPanel.setSelection(advanced.getItem(6));
LayoutContainer container = new LayoutContainer();
container.setAutoWidth(true);
container.setSize("30%", "250");
container.add(tabPanel );
RootPanel.get().add(container);