自由时飞扬

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
Ext.onReady(function(){
	var _window = new Ext.Window({
		title:"用户登陆",
		frame:true,
		width:250,
		height:130,
		plain:true,
		layout:"form",
		labelWidth:45,
		resizable:false,
		constrain:true,
		closeAction:"hide",
		defaults:{xtype:"textfield",width:160},
		bodyStyle:"padding:5px;",
		listeners:{
			"show":function(){
				alert("窗口显示");
			},
			"hide":function(){
				alert("窗口隐藏");
			}
		},
		items:[
			{fieldLabel:"账号"},
			{fieldLabel:"密码"}
			],
		buttons:[
			{text:"确定",handler:function(){
					var _coll = this.ownerCt.ownerCt.items;
//					alert(this.ownerCt.ownerCt.title);
					alert(_coll.first().getValue() + _coll.itemAt(1).getValue());
				}
			},
			{text:"取消",handler:function(){
					_window.hide();
				}
			}
		]
	});
	
	_window.render(Ext.getBody());
	_window.show();
});

 

当然,也可以用Ext.getCmp()来实现,效果图:

未命名

posted on 2010-11-25 20:13  selfly  阅读(437)  评论(0编辑  收藏  举报