3 * @class Roo.bootstrap.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.bootstrap.panel.Nest = function(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);
27 config.el = config.layout.getEl();
29 Roo.bootstrap.panel.Nest.superclass.constructor.call(this, config);
31 layout.monitorWindowResize = false; // turn off autosizing
32 this.layout = config.layout;
33 this.layout.getEl().addClass("roo-layout-nested-layout");
40 Roo.extend(Roo.bootstrap.panel.Nest, Roo.bootstrap.panel.Content, {
42 setSize : function(width, height){
43 if(!this.ignoreResize(width, height)){
44 var size = this.adjustForComponents(width, height);
45 var el = this.layout.getEl();
46 el.setSize(size.width, size.height);
47 var touch = el.dom.offsetWidth;
49 // ie requires a double layout on the first pass
50 if(Roo.isIE && !this.initialized){
51 this.initialized = true;
57 // activate all subpanels if not currently active..
59 setActiveState : function(active){
62 this.fireEvent("deactivate", this);
66 this.fireEvent("activate", this);
67 // not sure if this should happen before or after..
69 return; // should not happen..
72 for (var r in this.layout.regions) {
73 reg = this.layout.getRegion(r);
74 if (reg.getActivePanel()) {
75 //reg.showPanel(reg.getActivePanel()); // force it to activate..
76 reg.setActivePanel(reg.getActivePanel());
79 if (!reg.panels.length) {
82 reg.showPanel(reg.getPanel(0));
91 * Returns the nested BorderLayout for this panel
92 * @return {Roo.BorderLayout}
94 getLayout : function(){
99 * Adds a xtype elements to the layout of the nested panel
103 xtype : 'ContentPanel',
110 xtype : 'NestedLayoutPanel',
116 items : [ ... list of content panels or nested layout panels.. ]
120 * @param {Object} cfg Xtype definition of item to add.
122 addxtype : function(cfg) {
123 return this.layout.addxtype(cfg);