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.log('Nest Construct!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!');
32 Roo.bootstrap.panel.Nest.superclass.constructor.call(this, config);
34 config.layout.monitorWindowResize = false; // turn off autosizing
35 this.layout = config.layout;
36 this.layout.getEl().addClass("roo-layout-nested-layout");
43 Roo.extend(Roo.bootstrap.panel.Nest, Roo.bootstrap.panel.Content, {
45 setSize : function(width, height){
46 if(!this.ignoreResize(width, height)){
47 var size = this.adjustForComponents(width, height);
48 var el = this.layout.getEl();
49 if (size.height < 1) {
50 el.setWidth(size.width);
52 el.setSize(size.width, size.height);
54 var touch = el.dom.offsetWidth;
56 // ie requires a double layout on the first pass
57 if(Roo.isIE && !this.initialized){
58 this.initialized = true;
64 // activate all subpanels if not currently active..
66 setActiveState : function(active){
68 this.setActiveClass(active);
71 this.fireEvent("deactivate", this);
75 this.fireEvent("activate", this);
76 // not sure if this should happen before or after..
78 return; // should not happen..
81 for (var r in this.layout.regions) {
82 reg = this.layout.getRegion(r);
83 if (reg.getActivePanel()) {
84 //reg.showPanel(reg.getActivePanel()); // force it to activate..
85 reg.setActivePanel(reg.getActivePanel());
88 if (!reg.panels.length) {
91 reg.showPanel(reg.getPanel(0));
100 * Returns the nested BorderLayout for this panel
101 * @return {Roo.BorderLayout}
103 getLayout : function(){
108 * Adds a xtype elements to the layout of the nested panel
112 xtype : 'ContentPanel',
119 xtype : 'NestedLayoutPanel',
125 items : [ ... list of content panels or nested layout panels.. ]
129 * @param {Object} cfg Xtype definition of item to add.
131 addxtype : function(cfg) {
132 return this.layout.addxtype(cfg);