ExtJS:学习笔记五:window窗口-登陆

<script type='text/javascript'>
	Ext.onReady(function() {
		//window继承与panel但不是panel,它有个显现过程
		var _window = new Ext.Window({
			//始终要记住,要想显示你创建的组件,第一要穿件组件,第二要显示
			//renderTo:Ext.getBody(),
			title:"登    陆",
			frame:true,//直角变成圆角,还有其他变化
			layout:"form",
			modal:true,
			plain:true,//尽可能的与当前界面协调
			width:260,
			height:130,
			labelWidth:45,
			bodyStyle:"padding:5px",
			plain:true,//尽可能的与当前界面协调
			defaults:{xtype:"textfield",width:180},
			items:[
			       {fieldLabel:"账   号"},{fieldLabel:"密    码"}
			       ],
			buttons:[
			         //Closes the window, removes it from the DOM and destroys the window object.
			         //The beforeclose event is fired before the...
					 //尽量不要用close方法,为什么它是dom级别的。你的cpu将会-----
					 //主张隐藏。
			         	{text:"确   定",handler:function(){alert("go to index.html");}},
			         
			         	{text:"取  消",handler:function(){_window.hide();}}
			         ]
		});	
		_window.show();
	});
</script>

你可能感兴趣的:(function,layout,ExtJs,Go)