PDA

View Full Version : content panel with grid -- size problem



vinod.prathipati
15 Oct 2009, 5:41 AM
Hi ,

Mine is simple application which is simlar to Explorer example of GXT examples.

The following is the problem description.

1) I have a ContentPanel(centerPanel).


viewport = new Viewport();
viewport.setLayout(new BorderLayout());
viewport.add(northPanel, data);
viewport.add(westPanel, data);



centerPanel = new ContentPanel();

centerPanel.setBorders(false);
centerPanel.setHeaderVisible(false);
centerPanel.setLayout(new FitLayout());
BorderLayoutData data = new BorderLayoutData(LayoutRegion.CENTER);

data.setMargins(new Margins(5, 5, 5, 0));
viewport.add(centerPanel, data);
-------------------------------------------

2) TabPanel is added to center panel.
tabPanel = new TabPanel();
tabPanel.setCloseContextMenu(true);
tabPanel.setBorderStyle(false);
tabPanel.setBodyBorder(false);
tabPanel.setTabScroll(true);
tabPanel.setAnimScroll(true);
tabPanel.setTabPosition(TabPosition.TOP);
---------------------------------------------
3) TabItem is added to Tabpanel

Grid<File> grid =

new Grid<File>(store, cm);

grid.setView(view);

grid.setBorders(true);






ContentPanel panel =



new ContentPanel();

panel.setHeading("Missing Files");

panel.setCollapsible(true);
panel.setFrame(true);
panel.setSize(700, 450);
panel.setLayout(new FitLayout());
panel.add(grid);






item = new TabItem();

item.setClosable(entry.isClosable());

item.setId(entry.getId());
item.setText(entry.getName());
item.setLayout(new FitLayout());
item.add(panel);
tabPanel.add(item);





Here I am setting the size of panel to (700, 450). So the grid which is part of panel is coming as very small. But I want to set the size of grid to fit into my center panel based on auto sizing.




Can anybody help on this?




Thanks,

Vinod

vinod.prathipati
15 Oct 2009, 8:24 AM
Can anybody help me...

sven
20 Oct 2009, 8:24 AM
You should try to post some working example that is runnable for others.