PDA

View Full Version : help needed with border layout



imoise
11 Dec 2007, 3:48 AM
hy everyone. i have a problem migrating my portal from ext1.0 to ext 2. my layout is very simple.i have a tabPanel and under one tab i have a border layout with east and west. the tabs are Ext.Panel, and the border layout is a Ext.Panel with layout:"border". The problem is that when i load the content for a certain tab it does not render if it is Ext.panel. cand anyone help me.. this is my code..

this the tab content



Ext.onReady(function(){

Ext.state.Manager.setProvider(new Ext.state.CookieProvider());

var viewport = new Ext.Panel({
layout:'border',
items:[
new Ext.BoxComponent({ // raw
region:'north',
el: 'north'
}), {
region:'east',
title: 'East Side',
collapsible: true,
split:true,
width: 225,
minSize: 175,
maxSize: 400,
layout:'fit',
margins:'0 5 0 0',
items:
new Ext.Panel({
border:false
})
},{
region:'west',
id:'west-panel',
title:'West',
split:true,
width: 200,
minSize: 175,
maxSize: 400,
collapsible: true,
margins:'0 0 0 5',
layout:'accordion',
layoutConfig:{
animate:true
},
items: [{
title:'Navigation',
border:true,
iconCls:'nav'
},{
title:'Settings',
html:'<p>Some settings in here.</p>',
border:true,
iconCls:'settings'
},{
title:'feeds',
iconCls:'settings'
}]
},
new Ext.Panel({
region:'center',

})
]
});



});


this is my layout



var homePanel=new Ext.Panel({title: 'Home', closable: false});
rssNewsPanel=new Ext.Panel({
title: 'RSS news',
closable: true,
autoLoad:{url:'rssNews.jsp',scripts:true}
});
var eMailPanel= new Ext.Panel({title: 'eMail', closable: false});
var eCarePanel= new Ext.Panel({title: 'eCare', closable: false});
var complimentPanel= new Ext.Panel({title: 'Compliment', closable: false});


var tabs = new Ext.TabPanel({
renderTo: "tabs",
defaults:{autoScroll: true},
items:[homePanel,eMailPanel,eCarePanel,complimentPanel,rssNewsPanel]
});




please help...

tryanDLS
11 Dec 2007, 7:33 AM
You are creating a border layout in a panel with no height - this should probably be a Viewport. Then you're creating a bunch of panels with no relation to anything else - where are they going to render. Have you looked at the complex layout example? Suggest you read some other threads - there are many examples of adding panels to layouts.