<html>
<head>
<!-- Ext容器Demo -->
<script src="js/ext-all.js"></script>
<link href="css/ext-theme-gray-all.css" type="text/css" rel="stylesheet" />
<script type="text/javascript">
Ext.onReady(function() {
Ext.create('Ext.container.Container', {
layout: {
/* 布局可选: vbox(纵向)、hbox(水平)*/
type: 'vbox'
},
shadow:true,
floating: true,/* 在该容器中需要指定为true时才能进行拖动 */
/* 拖动范围:任意 */
draggable:true,/* 设置为true时该容器能够进行拖动 */
/* 在指定范围内拖动 */
constrain: true, /*拖动限制在这个组件组件中,即 loadcontainer中,默认为false*/
width: 400,
renderTo: Ext.DomQuery.selectNode("div[@id='loadcontainer']"),
border: 1,
style: {borderColor:'#C0C0C0', borderStyle:'solid', borderWidth:'1px'},
items: [{
xtype: 'datefield',
name: 'startDate',
fieldLabel: 'Start date'
},{
xtype: 'datefield',
name: 'endDate',
fieldLabel: 'End date'
}]
});
});
</script>
</head>
<body>
<br>
<div id="loadcontainer" style="margin-left: 100px;">
</div>
<br>
</body>
</html>
Ext学习笔记(4):容器Demo
最新推荐文章于 2023-06-03 00:28:17 发布