Forum /
Ext GWT Community Forums (2.x) /
Ext GWT: Q&A /
Unanswered: Grid that fills with contentpanel.
Unanswered: Grid that fills with contentpanel.
I am trying to create a grid that fills the width of a ContentPanel when brownser is resizing.
Any ideas?
Here is my code:
GroupingView view = new GroupingView();
view.setEmptyText("No Data");
view.setForceFit(true);
grid = new Grid<CampaignResultListGrid>(store, cm);
grid.setView(view);
new QuickTip(grid);
grid.disableTextSelection(false);
grid.setColumnLines(true);
grid.setStripeRows(true);
grid.ensureDebugId("awrgrid");
grid.setAutoWidth(true);
initListener();
mainContent = GWT.create(ContentPanel.class);
mainContent.setFrame(true);
mainContent.layout(true);
mainContent.setLayout(new FitLayout());
mainContent.setTopComponent(initFilterPanel());
mainContent.add(grid);
mainContent.setHeight(Window.getClientHeight() - 98);
mainContent.setWidth("100%");
mainContent.ensureDebugId("panelgrid");
return mainContent;
Thanks.
using viewport
using viewport
why not use Viewport to be the top container.
Viewport viewport = new Viewport();
ContentPanel cp = new ContentPanel();
Grid grid = new Grid(store,columnModle);
cp.add(grid);
viewport.add(cp)
Thanks, it's working now.
I have just forgotten to tell you that i am a new be in GXT.
To add some small hint. In the code snippet are two FitLayouts missing. Both viewport and the contentpanel should have a FitLayout set to make the grid resize correctly.
Sencha is used by over two million developers. Join the community, wherever you’d like that community to be
or Join Us