效果如图:
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'select.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<link rel="stylesheet" type="text/css"
href="ext/resources/css/ext-all.css" />
<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">
/**
fileset布局
*/
Ext.onReady(function(){
var panelExt=new Ext.Panel({ //---------------基本信息
layout : 'column',
border:false,
items : [
{
columnWidth : 0.5,
layout : 'form',
border:false,
items : [
{
fieldLabel:'test1',
name:'test1',
xtype:'textfield'
}
]
},{
columnWidth : 0.5,
layout : 'form',
border:false,
items : [
{
fieldLabel:'test2',
name:'test2',
xtype:'textfield'
}
]
}
]
});
var panelExt2=new Ext.Panel({
layout : 'column',
border:false,
items : [
{
columnWidth : 0.5,
layout : 'form',
border:false,
items : [
{
fieldLabel:'test3',
name:'test3',
xtype:'textfield'
},{
fieldLabel:'test4',
name:'test4',
xtype:'textfield'
},{
fieldLabel:'test5',
name:'test5',
xtype:'textfield'
}
]
},{
columnWidth : 0.5,
layout : 'form',
border:false,
items : [
{
fieldLabel:'test6',
name:'test6',
xtype:'textfield'
},{
fieldLabel:'test7',
name:'test7',
xtype:'textfield'
},{
fieldLabel:'test8',
name:'test8',
xtype:'textfield'
}
]
}
]
});
var panelExt3=new Ext.Panel({
layout:'form',
border:false,
items :[{
fieldLabel:'test10',
name:'test10',
xtype:'textfield'
}]
}) ;
var fieldset = new Ext.form.FieldSet({
checkboxToggle : false,
checkboxName :'expAccountFlag',
title : '基本信息',
autoHeight : true,
width : 800,
defaultType : 'textfield',
defaults : {
bodyStyle : 'padding: 5px;'
},
collapsed : false,
items :[panelExt]
});
var fieldset2 = new Ext.form.FieldSet({
checkboxToggle : false,
checkboxName :'expAccountFlag',
title : '其它信息',
autoHeight : true,
width : 800,
defaultType : 'textfield',
defaults : {
bodyStyle : 'padding: 5px;'
},
collapsed : false,
items :[panelExt2]
});
var fieldset3= new Ext.form.FieldSet({
checkboxToggle : false,
checkboxName :'expAccountFlag',
title : 'test',
autoHeight : true,
width : 300,
defaultType : 'textfield',
defaults : {
bodyStyle : 'padding: 5px;'
},
collapsed : false,
items :[panelExt3]
});
var panelExtAll=new Ext.FormPanel({
applyTo :'panel',
border:false,
items : [
{
layout : 'column',
border : false,
items : [
{
columnWidth : 0.7,
layout : 'form',
border:false,
items : [
fieldset,fieldset2
]
},{
columnWidth : 0.3,
layout : 'form',
height:200,
border:false,
items : [
fieldset3
]
}
]
},{
fieldLabel:'哈哈',
xtype:'textfield'
}
]
});
});
</script>
</head>
<body>
<div id="panel"></div>
</body>
</html>