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 config.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 if (size.height < 1) {
47 el.setWidth(size.width);
49 el.setSize(size.width, size.height);
51 var touch = el.dom.offsetWidth;
53 // ie requires a double layout on the first pass
54 if(Roo.isIE && !this.initialized){
55 this.initialized = true;
61 // activate all subpanels if not currently active..
63 setActiveState : function(active){
65 this.setActiveClass(active);
68 this.fireEvent("deactivate", this);
72 this.fireEvent("activate", this);
73 // not sure if this should happen before or after..
75 return; // should not happen..
78 for (var r in this.layout.regions) {
79 reg = this.layout.getRegion(r);
80 if (reg.getActivePanel()) {
81 //reg.showPanel(reg.getActivePanel()); // force it to activate..
82 reg.setActivePanel(reg.getActivePanel());
85 if (!reg.panels.length) {
88 reg.showPanel(reg.getPanel(0));
97 * Returns the nested BorderLayout for this panel
98 * @return {Roo.BorderLayout}
100 getLayout : function(){
105 * Adds a xtype elements to the layout of the nested panel
109 xtype : 'ContentPanel',
116 xtype : 'NestedLayoutPanel',
122 items : [ ... list of content panels or nested layout panels.. ]
126 * @param {Object} cfg Xtype definition of item to add.
128 addxtype : function(cfg) {
129 return this.layout.addxtype(cfg);