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 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!');
67 this.setActiveClass(active);
70 this.fireEvent("deactivate", this);
74 this.fireEvent("activate", this);
75 // not sure if this should happen before or after..
77 return; // should not happen..
80 for (var r in this.layout.regions) {
81 reg = this.layout.getRegion(r);
82 if (reg.getActivePanel()) {
83 //reg.showPanel(reg.getActivePanel()); // force it to activate..
84 reg.setActivePanel(reg.getActivePanel());
87 if (!reg.panels.length) {
90 reg.showPanel(reg.getPanel(0));
99 * Returns the nested BorderLayout for this panel
100 * @return {Roo.BorderLayout}
102 getLayout : function(){
107 * Adds a xtype elements to the layout of the nested panel
111 xtype : 'ContentPanel',
118 xtype : 'NestedLayoutPanel',
124 items : [ ... list of content panels or nested layout panels.. ]
128 * @param {Object} cfg Xtype definition of item to add.
130 addxtype : function(cfg) {
131 return this.layout.addxtype(cfg);