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");
34 this.layout.parent = this;
41 Roo.extend(Roo.bootstrap.panel.Nest, Roo.bootstrap.panel.Content, {
43 setSize : function(width, height){
44 if(!this.ignoreResize(width, height)){
45 var size = this.adjustForComponents(width, height);
46 var el = this.layout.getEl();
47 if (size.height < 1) {
48 el.setWidth(size.width);
50 el.setSize(size.width, size.height);
52 var touch = el.dom.offsetWidth;
54 // ie requires a double layout on the first pass
55 if(Roo.isIE && !this.initialized){
56 this.initialized = true;
62 // activate all subpanels if not currently active..
64 setActiveState : function(active){
66 this.setActiveClass(active);
69 this.fireEvent("deactivate", this);
73 this.fireEvent("activate", this);
74 // not sure if this should happen before or after..
76 return; // should not happen..
79 for (var r in this.layout.regions) {
80 reg = this.layout.getRegion(r);
81 if (reg.getActivePanel()) {
82 //reg.showPanel(reg.getActivePanel()); // force it to activate..
83 reg.setActivePanel(reg.getActivePanel());
86 if (!reg.panels.length) {
89 reg.showPanel(reg.getPanel(0));
98 * Returns the nested BorderLayout for this panel
99 * @return {Roo.BorderLayout}
101 getLayout : function(){
106 * Adds a xtype elements to the layout of the nested panel
110 xtype : 'ContentPanel',
117 xtype : 'NestedLayoutPanel',
123 items : [ ... list of content panels or nested layout panels.. ]
127 * @param {Object} cfg Xtype definition of item to add.
129 addxtype : function(cfg) {
130 return this.layout.addxtype(cfg);