ext--form layout

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>layout_form.html</title>
	
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="this is my page">
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    
    <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">
		Ext.onReady(function(){
			var f = new Ext.form.FormPanel(
				{
					title:"灵活布局的表单",//表单标题
					labelAlign:"right",//标签布局
					labelWidth:65,//标签宽度
					layout:"form",//表单布局,form(由上至下)
					width:700,//表单宽度
					autoHeight:true,//自动计算高度
					frame:true,//显示效果更好
					url:"",//提交到的url
					method:"post",//提交方式
					items:[ //表单组件
						{ // 第一行
							layout:"column",//布局,column(从左到右),结合form与column可以制作任意布局的表单。
							items:[
								{
									columnWidth:0.33,//占一行的百分比
									layout:"form",//布局
									items:[//具体的表单组件。
										{
											xtype:"textfield",
											name:"family",
											fieldLabel:"姓",
											width:165
										}
									]
								},
								{
									columnWidth:0.33,
									layout:"form",
									items:[
										{
											xtype:"textfield",
											name:"name",
											fieldLabel:"名",
											width:165
										}
									]
								},
								{
									columnWidth:0.33,
									layout:"form",
									items:[
										{
											xtype:"textfield",
											name:"enName",
											fieldLabel:"英文名",
											width:165
										}
									]
								}
							]
						},
						{ // 第2行
							layout:"column",
							items:[
								{
									columnWidth:0.5,
									layout:"form",
									items:[
										{
											xtype:"textfield",
											name:"family",
											fieldLabel:"座右铭1",
											width:250
										}
									]
								},
								{
									columnWidth:0.5,
									layout:"form",
									items:[
										{
											xtype:"textfield",
											name:"name",
											fieldLabel:"座右铭2",
											width:250
										}
									]
								}
							]
						},
						{ // 行3
							layout:"form",
							items:[
								{
									xtype:"textfield",
									name:"up",
									width:500,
									fieldLabel:"奖励"
								}
							]
						},
						{ // 行4
							layout:"form",
							items:[
								{
									xtype:"textfield",
									name:"lown",
									width:500,
									fieldLabel:"处罚"
								}
							]
						},
						{ // 第5行
							layout:"column",
							items:[
								{
									columnWidth:0.25,
									layout:"form",
									items:[
										{
											xtype:"textfield",
											name:"moive",
											fieldLabel:"最爱电影",
											width:125
										}
									]
								},
								{
									columnWidth:0.25,
									layout:"form",
									items:[
										{
											xtype:"textfield",
											name:"music",
											fieldLabel:"最爱音乐",
											width:125
										}
									]
								},
								{
									columnWidth:0.25,
									layout:"form",
									items:[
										{
											xtype:"textfield",
											name:"singer",
											fieldLabel:"最爱歌手",
											width:125
										}
									]
								},
								{
									columnWidth:0.25,
									layout:"form",
									items:[
										{
											xtype:"textfield",
											name:"sport",
											fieldLabel:"最爱运动",
											width:125
										}
									]
								}
							]
						},
						{ // 行6
							layout:"form",
							items:[
								{
									xtype:"htmleditor",
									name:"pragrpha",
									fieldLabel:"文章",
									width:500
								}
							]
						}
					],
					buttonAlign:"center",//按钮布局。
					buttons:[
						{
							text:"确定",
							icon:"../ext/resources/images/default/dd/drop-yes.gif",
							cls:"x-btn-text-icon"
						},{
							text:"取消",
							icon:"../ext/resources/images/default/dd/drop-no.gif",
							cls:"x-btn-text-icon"
						}
					],
					renderTo:"f"//绑定到某个元素上。
				}
			);		
		});
	</script>
  </head>
  
  <body >
  	<div align="center" id="f"></div>
  </body>
</html>



  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值