<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Window 窗口</title>
<link rel="stylesheet" type="text/css" href="../ext-2.1/resources/css/ext-all.css" />
<script type="text/javascript" src="../ext-2.1/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="../ext-2.1/ext-all.js"></script>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<script type="text/javascript">
/*******************************************************************************************
ExtJS中窗口是由Ext.Window类定义,该类继承自Panel,因此窗口其实是一种特殊的面板Panel。
窗口包含了浮动、可拖动、可关闭、最大化、最小化等特性。看下面的代码:
********************************************************************************************/
var i = 0 ;
function newwin(){
alert("333");
var win = new Ext.Window({title:"窗口"+i++,
width:400,
height:300,
maximizable:true}); //最大化
win.show(); //显示窗口
}
Ext.onReady(function () {
alert("1");
Ext.get("btn").on("click",newwin);
});
</script>
</head>
<body>
<input id="btn" type="button" name = "add" value="新窗口"/>
</body>
</html>