PDA

View Full Version : border layout Panel in TabPanel



firewood
25 May 2011, 1:21 AM
Hello?I have a panel that is border layout, I put it into a TabPanel?but the panel doesn`t show, why?If the panel is other layout, it can show on the TabPanel

friend
25 May 2011, 9:36 AM
Look at line 28 of the code sample you provided.

Oh, wait...

;)

friend
25 May 2011, 9:42 AM
Here's a terse/functional code sample which features a border layout panel as the first/only tab of a TabPanel.



<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>

<link rel="stylesheet" type="text/css" href="ext/resources/css/ext-all.css" />
<link rel="stylesheet" type="text/css" href="ext/resources/css/xtheme-blue.css" id="theme" />

<script type="text/javascript" src="ext/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="ext/ext-all.js"></script>

<script type="text/javascript">
Ext.onReady(function() {
Ext.BLANK_IMAGE_URL = 'ext/resources/images/default/s.gif';
Ext.QuickTips.init();

var t = new Ext.TabPanel({
renderTo:'contentDiv',
activeTab: 0,
height: 600,
width: 800,
items:[{
xtype: 'panel',
layout: 'border',
title: 'Tab 1',
items: [{
xtype: 'panel',
region: 'north',
frame: true,
height: 50,
html: 'This is the North Region.'
},{
xtype: 'panel',
region: 'center',
layout: 'fit',
html: 'This is the Center Region.'
}]
}]
});

});
</script>
</head>
<body>
<div id="contentDiv">
</div>
</body>
</html>

firewood
25 May 2011, 9:17 PM
var tabPnl = new tabPanelCreater({
plain:true,
heigth:500,
activeTab : 0,
width:950,
frame:true,
border:true,
applyTo:'center'

});

var mainPnl = new panelCreater({
layout:'border',
title:'????',
height:500,
border:true,
autoScroll:false,
frame:true,
items:[{title:'west',region:'west',width:20},{title:'center', region:'center'},{title:'east', region:'east',width:30}]
});

tabPnl.add(mainPnl);

this is my code,but the panel in the tabpanel does`t show content

friend
26 May 2011, 11:26 AM
Try changing this:


tabPnl.add(mainPnl);

To This:



tabPnl.add(mainPnl);
tabPnl.doLayout();