PDA

View Full Version : [2.0 rc1] Problem with FormPanel as a item inTabPanel



kohwuyea
27 Nov 2007, 1:45 AM
When I put a FormPanel that has two columns into the TabPanel ,but it seems that the FormPanel with columns can't display correct,I will be so grad if anybody will take some time to help me?
the HTML CODE:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Tabs Example</title>
<link rel="stylesheet" type="text/css" href="../../resources/css/ext-all.css" />

<!-- GC -->
<!-- LIBS -->
<script type="text/javascript" src="../../adapter/ext/ext-base.js"></script>
<!-- ENDLIBS -->

<script type="text/javascript" src="../../ext-all.js"></script>
<!-- Tabs Example Files -->
<link rel="stylesheet" type="text/css" href="tabs-example.css" />
<script type="text/javascript" src="tabs-example.js"></script>
<!-- Common Styles for the examples -->
<link rel="stylesheet" type="text/css" href="../examples.css" />
</head>
<body>
<script type="text/javascript" src="../examples.js"></script><!-- EXAMPLES -->
<h1>Tab Panel Examples</h1>
<p>Note that the js and css is not minified so it is readable. See <a href="tabs-example.js">tabs-example.js</a> for the tab creation code
and <a href="tabs-example.css">tabs-example.css</a> for the css.</p>
<h3>Tabs with auto height that resize to the content. Built from existing markup.</h3><br>
<!-- container for the existing markup tabs -->
<div id="tabs1">
<div id="script" class="x-hide-display">
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed metus nibh, sodales a, porta at, vulputate eget, dui. Pellentesque ut nisl. Maecenas tortor turpis, interdum non, sodales non, iaculis ac, lacus.<br/><br/> Vestibulum auctor, tortor quis iaculis malesuada, libero lectus bibendum purus, sit amet tincidunt quam turpis vel lacus. In pellentesque nisl non sem. Suspendisse nunc sem, pretium eget, cursus a, fringilla vel, urna.</p>
</div>
<div id="markup" class="x-hide-display">
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed metus nibh, sodales a, porta at, vulputate eget, dui. Pellentesque ut nisl. Maecenas tortor turpis, interdum non, sodales non, iaculis ac, lacus. Vestibulum auctor, tortor quis iaculis malesuada, libero lectus bibendum purus, sit amet tincidunt quam turpis vel lacus. In pellentesque nisl non sem. Suspendisse nunc sem, pretium eget, cursus a, fringilla vel, urna.<br/><br/>Aliquam commodo ullamcorper erat. Nullam vel justo in neque porttitor laoreet. Aenean lacus dui, consequat eu, adipiscing eget, nonummy non, nisi. Morbi nunc est, dignissim non, ornare sed, luctus eu, massa. Vivamus eget quam. Vivamus tincidunt diam nec urna. Curabitur velit.</p>
</div>
</div>
<br>
<h3>Tabs with no tab strip and a fixed height that scroll the content. Built entirely with javascript.</h3>
<ul class="list">
<li>Tab 1 is a normal tab with content passed when adding it.</li>
<li>Tab 2 is loaded via Ajax.</li>
<li>Tab 3 is loaded via Ajax too. It was set up to pass parameters when loaded.</li>
<li>Tab 4 has an event listener attached.</li>
<li>Tab 5 is disabled.</li>
</ul><br>

</body>
</html>
and the javascript code is:

/*
* Ext JS Library 2.0 RC 1
* Copyright(c) 2006-2007, Ext JS, LLC.
* [email protected]
*
* http://extjs.com/license
*/

Ext.onReady(function(){
Ext.QuickTips.init();
var tabs = new Ext.TabPanel({
renderTo:'tabs',
resizeTabs:true, // turn on tab resizing
minTabWidth: 115,
tabWidth:135,
enableTabScroll:true,
width:600,
height:250,
defaults: {autoScroll:true},
plugins: new Ext.ux.TabCloseMenu()
});
// tab generation code
var index = 0;
while(index < 7){
addTab();
}
var tab2 = new Ext.FormPanel({
title: 'Inner Tabs',
bodyStyle:'padding:5px',
width: 600,
height:'auto',
closable:true,
items: [{
layout:"column",
border:false,
items:[{
columnWidth:0.5,
layout:"form",
border:false,
items:[{
fieldLabel:"Value",
xtype:"textfield",
value:"4GB"
}]
},{
columnWidth:0.5,
layout:"form",
border:false,
items:[{
fieldLabel:"Value",
xtype:"textfield",
value:"4GB"
}]
}]
}],
buttons: [{
text: 'Save'
},{
text: 'Cancel'
}]
});
tabs.add(tab2).show();
var tab3 = new Ext.FormPanel({
title: 'Inner Tabs',
bodyStyle:'padding:5px',
width: 600,
closable:true,
items: [{
layout:"column",
border:false,
items:[{
columnWidth:0.5,
layout:"form",
border:false,
items:[{
fieldLabel:"Value",
xtype:"textfield",
value:"4GB"
}]
},{
columnWidth:0.5,
layout:"form",
border:false,
items:[{
fieldLabel:"Value",
xtype:"textfield",
value:"4GB"
}]
}]
}],
buttons: [{
text: 'Save'
},{
text: 'Cancel'
}]
});
tab3.render(document.body);
function addTab(){
tabs.add({
title: 'New Tab ' + (++index),
iconCls: 'tabs',
html: 'Tab Body ' + (index) + '<br/><br/>'
+ Ext.example.bogusMarkup,
closable:true
}).show();
}
new Ext.Button({
text: 'Add Tab',
handler: addTab,
iconCls:'new-tab'
}).render(document.body, 'tabs');
});
the sreenshot i got is:
http://extjs.com/forum/attachment.php?attachmentid=2987&stc=1&d=1196156671
thanks very much!