4 * @class Roo.NestedLayoutPanel
5 * @extends Roo.ContentPanel
6 * @parent Roo.BorderLayout Roo.LayoutDialog builder
7 * @cfg {Roo.BorderLayout} layout [required] The layout for this panel
11 * Create a new NestedLayoutPanel.
14 * @param {Roo.BorderLayout} layout [required] The layout for this panel
15 * @param {String/Object} config A string to set only the title or a config object
17 Roo.NestedLayoutPanel = function(layout, config)
19 // construct with only one argument..
20 /* FIXME - implement nicer consturctors
23 layout = config.layout;
26 if (layout.xtype && !layout.getEl) {
27 // then layout needs constructing..
28 layout = Roo.factory(layout, Roo);
33 Roo.NestedLayoutPanel.superclass.constructor.call(this, layout.getEl(), config);
35 layout.monitorWindowResize = false; // turn off autosizing
37 this.layout.getEl().addClass("x-layout-nested-layout");
44 Roo.extend(Roo.NestedLayoutPanel, Roo.ContentPanel, {
48 setSize : function(width, height){
49 if(!this.ignoreResize(width, height)){
50 var size = this.adjustForComponents(width, height);
51 var el = this.layout.getEl();
52 el.setSize(size.width, size.height);
53 var touch = el.dom.offsetWidth;
55 // ie requires a double layout on the first pass
56 if(Roo.isIE && !this.initialized){
57 this.initialized = true;
63 // activate all subpanels if not currently active..
65 setActiveState : function(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);