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 Roo.log('setActiveState !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!');
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..
82 for (var r in this.layout.regions) {
83 reg = this.layout.getRegion(r);
85 if (reg.getActivePanel()) {
86 Roo.log('Active Panel????????????????????????????');
87 //reg.showPanel(reg.getActivePanel()); // force it to activate..
88 reg.setActivePanel(reg.getActivePanel());
91 Roo.log(reg.panels.length);
92 if (!reg.panels.length) {
95 reg.showPanel(reg.getPanel(0));
104 * Returns the nested BorderLayout for this panel
105 * @return {Roo.BorderLayout}
107 getLayout : function(){
112 * Adds a xtype elements to the layout of the nested panel
116 xtype : 'ContentPanel',
123 xtype : 'NestedLayoutPanel',
129 items : [ ... list of content panels or nested layout panels.. ]
133 * @param {Object} cfg Xtype definition of item to add.
135 addxtype : function(cfg) {
136 return this.layout.addxtype(cfg);