﻿/// <reference path="http://www-app.gdepb.gov.cn/ext-2.2/vswd-ext_2.1.js" />
Ext.namespace('EQPublish');

EQPublish.ProtectedWindow = Ext.extend(Ext.Window, {
	ascxHandlerUrl: '',
	ascxUrl: '',
	ID: '',
	initComponent: function() {
		Ext.apply(this, {
			id: 'protectedwindows',
			closeAction: 'hide',
			width: 700,
			height: 836,
			resizable: false,
			buttons: [{ text: '关闭', handler: this._onCloseClick, scope: this}],
			buttonAlign: 'center'
		});
		EQPublish.ProtectedWindow.superclass.initComponent.call(this, arguments);
	},
	_onCloseClick: function() {
		this.hide();
	},
	initEvents: function() {
		EQPublish.ProtectedWindow.superclass.initEvents.apply(this, arguments);
	},
	afterRender: function() {
		EQPublish.ProtectedWindow.superclass.afterRender.call(this, arguments);
	},
	update: function() {
		this.getUpdater().showLoadIndicator = true;
		this.getUpdater().update({
			url: this.ascxHandlerUrl,
			params: { path: this.ascxUrl,  ID: this.ID },
			text: "正在加载数据..."
		});
	},
	show: function() {
		EQPublish.ProtectedWindow.superclass.show.apply(this, arguments);
		this.update();
		this.filter = 0;
	},
	setID: function(id) {
		this.ID = id;
	}
});
Ext.reg('protectedwindow', EQPublish.ProtectedWindow);


