-
12 Dec 2011 9:06 AM #1
Grid autoExpand not working
Grid autoExpand not working
Can some1 pls tell me what I'm doing wrong? My grid wont fill the entire grids width.
The grid is correctly sized in width but the 1 column does not take the whole width of the grid.
Code:public class LayoutContainerX extends LayoutContainer { private final ColumnConfig c = new ColumnConfig("value","value", 200); private final ListStore<ModelData> store = new ListStore<ModelData>(); private final Grid<ModelData> grid = new Grid<ModelData>(store, new ColumnModel(Arrays.asList(c))); public LayoutContainerX(){ grid.setAutoExpandColumn("value"); grid.setAutoHeight(true); } @Override protected void onRender(Element parent, int index) { super.onRender(parent, index); for (int i=0; i<10; i++){ BaseModelData data = new BaseModelData(); data.set("value", "value"); store.add(data); } add(grid); } }Last edited by Quartilan; 12 Dec 2011 at 11:17 PM. Reason: clarify the problem
-
13 Dec 2011 5:39 AM #2
I found that when I add the fillLayout to the parent layoutContainer that it works but now I have the problem that when I have a vertical scrollbar the resizing of the layoutcontainer is not taken into account.
-
13 Dec 2011 11:54 AM #3
Try this:
Code:public class LayoutContainerX extends LayoutContainer { private final ColumnConfig c = new ColumnConfig("value","value", 200); private final ListStore<ModelData> store = new ListStore<ModelData>(); private final Grid<ModelData> grid = new Grid<ModelData>(store, new ColumnModel(Arrays.asList(c))); public LayoutContainerX(){ this.setLayout(new FitLayout()); // other Layouts that fill the free space may work grid.setAutoExpandColumn("value"); grid.setAutoHeight(true); grid.getView().setForceFit(true); } @Override protected void onRender(Element parent, int index) { super.onRender(parent, index); for (int i=0; i<10; i++) { BaseModelData data = new BaseModelData(); data.set("value", "value"); store.add(data); } add(grid); } }
-
14 Dec 2011 4:24 AM #4
I tried it but no succes. After I sort the column then the column expands to the full size. But that is a bit late :-)


Reply With Quote