-
3 Aug 2008 6:55 AM #1
add and remove ContentPanel at runtime in BorderLayout
add and remove ContentPanel at runtime in BorderLayout
Is it possible to do something like
at runtimeCode:ContentPanel cp = new ContentPanel(); cp.setLayout(new BorderLayout()); LayoutContainer lc = new LayoutContainer(); BorderLayoutData bld = new BorderLayoutData(LayoutRegion.CENTER); cp.add(lc, bld);
?Code:lc.removeFromParent(); cp.add(new LayoutContainer(), new BorderlayoutData(LayoutRegion.CENTER);
-
3 Aug 2008 9:29 AM #2
you dont need to remove the panel from the center.
Add a dummy Panel to the center with header visibility to false and use removeAll and add to switch content.
at runtime:Code:ContentPanel cp = new ContentPanel(); cp.setLayout(new BorderLayout()); LayoutContainer lc = new ContentPanel(); lc.setHeaderVisibility(false); BorderLayoutData bld = new BorderLayoutData(LayoutRegion.CENTER); cp.add(lc, bld);
Code:lc.removeAll(); cp.add(new ContentPanel()); lc.layout();
greetings
daniel
-
3 Aug 2008 1:08 PM #3
...or if you are switching between content on the panel, use a cardpanel and it will pop between the contentpanels (or whatever widget you add) http://extjs.com/deploy/gxtdocs/com/...CardPanel.html
-
3 Aug 2008 2:15 PM #4


Reply With Quote