自由时飞扬

  BlogJava :: 首页 :: 联系 :: 聚合  :: 管理
  8 Posts :: 0 Stories :: 0 Comments :: 0 Trackbacks
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-26 09:20 selfly 阅读(135) 评论(0)  编辑  收藏

只有注册用户登录后才能发表评论。


网站导航: