PDA

View Full Version : [CLOSED]nested layouts fit/border render nothing on a screen



gs76pl
30 Mar 2011, 4:15 AM
hi,

There seems to be a problem while nesting border layout into fit layout or border layout with a different border layout. The upshot is that dynamically including some other panel renders nothing on a screen. The only time when i can see something is when XX.data.model.OtherPanel has a height specified explicitly (but i shouldn't do that as this panel uses fit layout !!!)

my configuration


Ext.define('XX.data.DataPanel', {
extend : 'Ext.panel.Panel',
title : 'Data',
initComponent: function() {

var mainContainer = new Ext.panel.Panel({
layout : 'border',
items : [{
region : 'north',
autoHeight :true,
items : []
},{
region : 'center',
id : 'dataModelSearchPanel'
}]
});

Ext.apply(this, {
items: [ mainContainer]
});

XX.data.DataPanel.superclass.initComponent.apply(this, arguments);

this.addOtherPanel(); //originally called from a click button
}

addOtherPanel : function(){
var searchPanel = Ext.getCmp('dataModelSearchPanel');
searchPanel.removeAll();

searchPanel.add(Ext.create('XX.data.model.OtherPanel'));
searchPanel.doLayout();

}
});

Ext.define('XX.data.model.OtherPanel', {
extend : 'Ext.panel.Panel',
layout : 'fit',
// height : 400,
// layout : 'border',
initComponent : function(){

this.items = [ {
xtype : 'panel',
layout: 'border',
id : 'yyy',
items : [{
xtype : 'panel',
region : 'north',
height : 200,
//autoHeight : true,
title :'c2222'
}, {
xtype : 'panel',
region: 'center',
title :'rrrrc2222'
}]
}];

/*
//this doesn't work either when used with 'border' layout
this.items = [{
xtype : 'panel',
region : 'north',
height : 200,
//autoHeight : true,
title :'c2222'
}, {
xtype : 'panel',
region: 'center',
height : 300,
title :'rrrrc2222'
}];*/

XX.data.OtherPanel.superclass.initComponent.apply(this, arguments);
}
});

evant
30 Mar 2011, 6:19 PM
This isn't a bug. dataModelSearchPanel is missing a layout.