extjs设置弹出窗口

在使用extjs时,点击一个按钮或链接,弹出一个窗口:

这里的例子弹出一个图片窗口。

按钮或超链接直接调用pictureWin(path);方法

function pictureWin(path){
	formWindow = newPictureWin(path);
	formWindow.show();
}
//图片窗口
function newPictureWin(path){
	var picForm = new Ext.form.FormPanel({
		labelAlign : 'right',
		fileUpload : true,
		border : false,
		frame : true,
		autoScroll : true,
		layout : 'fit',
		items : [{
			border : false,
			autoScroll : true,
			html:""
		}]
	});
	var window = new Ext.Window({
		title : '查看图片',
		width : 1000,
		height : 450,
		resizable : false,
		plain : false,
		frame : true,
		border : false,
		modal : true,
		constrainHeader : true,
		autoScroll : true,
		formPanel : picForm ,
		form : picForm .form,
		closeAction : 'hide',
		items : [ picForm  ],
		listeners : {
			beforeHide : function(){
				formWindow.show();
			}
		},
		buttons : [{
			text : '关闭',
			handler : function(){
				window.hide();
			}
		}]
	});
	return window;
}

 

你可能感兴趣的:(extjs)