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 {String/Object} config A string to set only the title or a config object
11 Roo.bootstrap.panel.Nest = function(config)
13 // construct with only one argument..
14 /* FIXME - implement nicer consturctors
17 layout = config.layout;
20 if (layout.xtype && !layout.getEl) {
21 // then layout needs constructing..
22 layout = Roo.factory(layout, Roo);
26 config.el = config.layout.getEl();
28 Roo.bootstrap.panel.Nest.superclass.constructor.call(this, config);
30 config.layout.monitorWindowResize = false; // turn off autosizing
31 this.layout = config.layout;
32 this.layout.getEl().addClass("roo-layout-nested-layout");
33 this.layout.parent = this;
40 Roo.extend(Roo.bootstrap.panel.Nest, Roo.bootstrap.panel.Content, {
42 * @cfg {Roo.BorderLayout} layout The layout for this panel
46 setSize : function(width, height){
47 if(!this.ignoreResize(width, height)){
48 var size = this.adjustForComponents(width, height);
49 var el = this.layout.getEl();
50 if (size.height < 1) {
51 el.setWidth(size.width);
53 el.setSize(size.width, size.height);
55 var touch = el.dom.offsetWidth;
57 // ie requires a double layout on the first pass
58 if(Roo.isIE && !this.initialized){
59 this.initialized = true;
65 // activate all subpanels if not currently active..
67 setActiveState : function(active){
69 this.setActiveClass(active);
72 this.fireEvent("deactivate", this);
76 this.fireEvent("activate", this);
77 // not sure if this should happen before or after..
79 return; // should not happen..
82 for (var r in this.layout.regions) {
83 reg = this.layout.getRegion(r);
84 if (reg.getActivePanel()) {
85 //reg.showPanel(reg.getActivePanel()); // force it to activate..
86 reg.setActivePanel(reg.getActivePanel());
89 if (!reg.panels.length) {
92 reg.showPanel(reg.getPanel(0));
101 * Returns the nested BorderLayout for this panel
102 * @return {Roo.BorderLayout}
104 getLayout : function(){
109 * Adds a xtype elements to the layout of the nested panel
113 xtype : 'ContentPanel',
120 xtype : 'NestedLayoutPanel',
126 items : [ ... list of content panels or nested layout panels.. ]
130 * @param {Object} cfg Xtype definition of item to add.
132 addxtype : function(cfg) {
133 return this.layout.addxtype(cfg);