View Full Version : Grid in SimpleContainer that is center of BorderLayoutContainer, cropped scrollbar

31 Jan 2012, 10:30 AM
If the GXT Grid is placed inside a SimpleContainer that is the center widget of a BorderLayoutContainer, the Grid does resize to the full size of the center of the border layout container, but the scrollbar is cropped. See attached screenshot.Also, a patch file for com.sencha.gxt.explorer.client.grid.GridExample is provided that demonstrates this defect.31197
### Eclipse Workspace Patch 1.0#P Ext GWTIndex: com.sencha.gxt.examples/src/main/java/com/sencha/gxt/explorer/client/grid/GridExample.java===================================================================--- com.sencha.gxt.examples/src/main/java/com/sencha/gxt/explorer/client/grid/GridExample.java (revision 2109)+++ com.sencha.gxt.examples/src/main/java/com/sencha/gxt/explorer/client/grid/GridExample.java (working copy)@@ -29,6 +29,8 @@ import com.sencha.gxt.state.client.GridStateHandler; import com.sencha.gxt.state.client.StateManager; import com.sencha.gxt.widget.core.client.ContentPanel;+import com.sencha.gxt.widget.core.client.container.BorderLayoutContainer;+import com.sencha.gxt.widget.core.client.container.SimpleContainer; import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer; import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer.VerticalLayoutData; import com.sencha.gxt.widget.core.client.form.SimpleComboBox;@@ -133,7 +135,24 @@ // content) that are setup in the change GridCellRenderer new QuickTip(grid); - return cp;+ +//Resizing of Grid doesn't work as expected. +// BorderLayoutContainer b = new BorderLayoutContainer();+// VerticalLayoutContainer v = new VerticalLayoutContainer();+// ContentPanel panel = new ContentPanel();+// panel.setHeadingText("HEADER");+// panel.add(new HTML("first child of view layout container, header resizes as expected."));+// v.add(panel);+// v.add(cp);+// b.add(v);+ + //Resizing of Grid works as expected, but scrollbar is cropped. + BorderLayoutContainer b = new BorderLayoutContainer();+ SimpleContainer sc = new SimpleContainer();+ b.setCenterWidget(sc);+ sc.add(cp);+ + return b; } @Override

31 Jan 2012, 10:44 AM
You cannot simple replace some inner container and hope that something magically works. The parent containers never resize their childrens. Do do that, you need to set fit to true on the annotation.