布局 border 与 form

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gbk">
<title>Checkbox TreePanel</title>
<link rel="stylesheet" type="text/css" href="/ext/docs/resources/ext-all.css" />
<script type="text/javascript" src="/ext/docs/resources/ext-base.js"></script>
<script type="text/javascript" src="/ext/docs/resources/ext-all.js"></script>
 
</head>
<body>
 
<div id="tree-div"></div>

</body>
 

     

Ext.onReady(function(){
	new Ext.Viewport({
		layout:{
			type:'border',
			padding: 5
		},
		defaults:{split:true},//含有拖拽的功能
		items:[{
			region:'north',
			html:'top<br>toptop',
			title:'North',
			collapsible:true, //面板是否可以 折叠,
			autoHeight:true,//高度和内容高度相同
			border:true,
			split:true,
			margins:'0 0 5 0'
		},{
			region:'center',
			html:'center',
			title:'Center',
			collapsible:true, //面板是否可以 折叠,
			
		},{
			region:'south',
			html:'south',
			title:'South',
			collapsible:true, //面板是否可以 折叠,
			height:100
			
		},{
			region:'west',
			title:'West',
			html:'west',
			collapsible:true, //面板是否可以 折叠,
			width: '15%'     //宽度占总宽度的15%
			
		},{
			region:'east',
			title:'East',
			html:'east',
			width:200,
			collapsible:true, //面板是否可以 折叠,
			bodyStyle:'padding:2px 10px 10px 2px', //使内部元素和边框 有一定距离 
			frame:true, 			//渲染背景颜色
	        labelWidth : 45,    	//显示的标签宽度为45 
	        labelAlign : "right", 	//标签内容右对齐
			layout:{
                type: 'form', 		//form 布局,这个布局中label 才能显示出来 
                padding: 5 
			},
			items:[{
                xtype: 'textfield',
				fieldLabel:'姓名',
				id:'name'
			},{
				xtype: 'textfield',
				fieldLabel:'昵称',
				id:'nickName'
			}]
			
		}]
	})
	
});

</script>
</html>

 

 

 

 

你可能感兴趣的:(border)