调用FormPanel组件生成表单,将表单添加到窗口里面作为它的子组件。
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
<link rel="stylesheet" type="text/css" href="resources/css/ext-all.css" />
<script type="text/javascript" src="ext-all-debug.js"></script>
<script type="text/javascript" src="ext-all.js"></script>
<script type="text/javascript" src="bootstrap.js"></script>
</head>
<body>
<script type="text/javascript">
Ext.onReady(function () {
var form = new Ext.form.FormPanel({
frame:true,
title:'表单标题',
style:'margin:10px',
html:'<div style="padding:10px">这里是表单内容</div>'
});
var win = new Ext.Window({
title:'窗口',
width:476,
height:374,
html:'<div>这里是窗口内容</div>',
resizable:true,
modal:true,
closable:true,
maximizable:true,
minimizable:true,//不是最后一项都必须有逗号
items:form
});
win.show();
});
</script>
</body>
</html>