Hi-
I have a border layout panel and I want to change the center region item:
switchTo : function(targetPanel) {
var oldCenter = VFA.controller.getPanelByRegion('center');
var viewPort = Ext.getCmp('viewport');
viewPort.remove(oldCenter);
var targetObj = Ext.getCmp(targetPanel);
viewPort.add(targetObj);
targetObj.show();
viewPort.doLayout();
}
This does seem to remove the existing center panel, but the new one does not appear. I do see the new panel appear in the item list (and the old panel disappear) of the border panel though so it appears it did get added properly but yet not rendered or something. What is the right way to do this? I've tried various incantations of calling render() without success.
I could use a card layout and achieve this but don't know if dynamically adding panels to a form panel would have the same effect. A step further, I could predefine all of the panels, add them to the card layout and then switchTo would simply be doing a setActiveItem(x). Computers & Structures : Dynamic analysis of thick laminated shell :: The resulting ordinary differential equations are solved by the finite element method. The panel is subjected to dynamic pressure excitation and three http://linkinghub.elsevier.com/retrieve/pii/S0045794906000988HOME |
But partly I'd like to not predfine all of the panels and partly I'd like to know if changing the panels items is possible (and what the right way to do it is).
Thanks
-Doug
Got it, thanks for the info.
I've got it working as a card layout now and its behaving itself quite nicely.
Thanks again
-Doug
Center region of border layout is somewhat special in that that it has to be present. In any other case add/remove/doLayout should work as expected.
Where's The Advantage In Windows Genuine Advantage?
Stocks Bounce After S&P Joins Bear Market |