布局 anchor

 

 

<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>

 

 

 

 

 
<script type="text/javascript">
Ext.onReady(function(){
	var panel1 = new Ext.Panel({
		title:"Panel1",
		height:100,
		anchor:'-50',
		html:'高度等于100,宽度=容器宽度-50'
	});
	
	var panel2 = new Ext.Panel({
		title:"Panel1",
		height:100,
		anchor:'50%',
		html:'高度等于100,宽度=容器宽度的50%'
		
	});

	var panel3 = new Ext.Panel({
        title: "panel3",   
        anchor: '-10, -250',   
        html: "宽度=容器宽度-10,高度=容器宽度-250"  
		
	});
	var win = new Ext.Window({
		title:'window使用',
		width:500,
		height:600,
		layout:{
			type:'anchor',
			padding: 5
		},
		defaults:{split:true},//含有拖拽的功能
		items:[ panel1,panel2, panel3]
	});
	
	win.show(); //调用了这个方法 窗口才能显示
	
});

</script>
</html>

 

 

 

你可能感兴趣的:(布局)