3 * @class Roo.boostrap.panel.Nest
4 * @extends Roo.bootstrap.panel.Content
6 * Create a new Panel, that can contain a layout.Border.
9 * @param {Roo.BorderLayout} layout The layout for this panel
10 * @param {String/Object} config A string to set only the title or a config object
12 Roo.NestedLayoutPanel = function(layout, config)
14 // construct with only one argument..
15 /* FIXME - implement nicer consturctors
18 layout = config.layout;
21 if (layout.xtype && !layout.getEl) {
22 // then layout needs constructing..
23 layout = Roo.factory(layout, Roo);
28 Roo.NestedLayoutPanel.superclass.constructor.call(this, layout.getEl(), config);
30 layout.monitorWindowResize = false; // turn off autosizing
32 this.layout.getEl().addClass("x-layout-nested-layout");
39 Roo.extend(Roo.NestedLayoutPanel, Roo.ContentPanel, {
41 setSize : function(width, height){
42 if(!this.ignoreResize(width, height)){
43 var size = this.adjustForComponents(width, height);
44 var el = this.layout.getEl();
45 el.setSize(size.width, size.height);
46 var touch = el.dom.offsetWidth;
48 // ie requires a double layout on the first pass
49 if(Roo.isIE && !this.initialized){
50 this.initialized = true;
56 // activate all subpanels if not currently active..
58 setActiveState : function(active){
61 this.fireEvent("deactivate", this);
65 this.fireEvent("activate", this);
66 // not sure if this should happen before or after..
68 return; // should not happen..
71 for (var r in this.layout.regions) {
72 reg = this.layout.getRegion(r);
73 if (reg.getActivePanel()) {
74 //reg.showPanel(reg.getActivePanel()); // force it to activate..
75 reg.setActivePanel(reg.getActivePanel());
78 if (!reg.panels.length) {
81 reg.showPanel(reg.getPanel(0));
90 * Returns the nested BorderLayout for this panel
91 * @return {Roo.BorderLayout}
93 getLayout : function(){
98 * Adds a xtype elements to the layout of the nested panel
102 xtype : 'ContentPanel',
109 xtype : 'NestedLayoutPanel',
115 items : [ ... list of content panels or nested layout panels.. ]
119 * @param {Object} cfg Xtype definition of item to add.
121 addxtype : function(cfg) {
122 return this.layout.addxtype(cfg);