﻿/// <reference path="http://www-app.gdepb.gov.cn/ext-2.2/vswd-ext_2.1.js" />
Ext.namespace('EQPublish');

/**
* 自然保护区
*/
EQPublish.InfoPlant1 = Ext.extend(Ext.Panel, {
	initComponent: function() {
		Ext.apply(this, {
			id: 'MoreInfo',
			title:'详细信息',
			autoScroll: true
		});
		EQPublish.InfoPlant1.superclass.initComponent.apply(this, arguments);
	},
	afterRender: function() {
		EQPublish.InfoPlant3.superclass.afterRender.apply(this, arguments);
		this._update();
	},
	_update: function() {
		if (this.newRegion) {
			this.getUpdater().update({
				url: ascxHandler,
				params: { path: '~/Controls/ProtectedRegionTab1.ascx', regionid: this.newRegion }
			});
			delete this.newRegion;
		}
	},
	setRegionId: function(regionID) {
		this.newRegion = regionID;
		if (this.rendered) {
			this._update();
		}
	}
});
Ext.reg('InfoPlant1', EQPublish.InfoPlant1);

EQPublish.InfoPlant2 = Ext.extend(Ext.Panel, {
	ascxHandlerUrl: '',
	mapChartHandlerUrl: '',
	initComponent: function() {
		Ext.apply(this, {
			id:'SubArea',
		//	title: '分区',
			autoScroll: true
		});
		EQPublish.InfoPlant2.superclass.initComponent.apply(this, arguments);
	},
	afterRender: function() {
		EQPublish.InfoPlant3.superclass.afterRender.apply(this, arguments);
		this._update();
	},
	_update: function() {
		if (this.newRegion) {
			var updater = this.getUpdater();
			updater.loadScripts= true;
			updater.update({
				url: ascxHandler,
				params: { path: '~/Controls/ProtectedRegionTab2.ascx', regionid: this.newRegion }
			});
			delete this.newRegion;
		}
	},
	setRegionId: function(regionID) {
		this.newRegion = regionID;
		if (this.rendered) {
			this._update();
		}
	}
});
Ext.reg('InfoPlant2', EQPublish.InfoPlant2);

EQPublish.InfoPlant3 = Ext.extend(Ext.Panel, {
	ascxHandlerUrl: '',
	mapChartHandlerUrl: '',
	initComponent: function() {
		Ext.apply(this, {
			id:'DocInfo',
			//title: '相关资料',
			width: '100%',
			//height: 150,
			autoScroll: true
		});
		EQPublish.InfoPlant3.superclass.initComponent.apply(this, arguments);
	},
	afterRender: function() {
		EQPublish.InfoPlant3.superclass.afterRender.apply(this, arguments);
		this._update();
	},
	_update: function() {
		if (this.newRegion) {
			this.getUpdater().update({
				url: ascxHandler,
				params: { path: '~/Controls/ProtectedRegionTab3.ascx', regionid: this.newRegion }
			});
			delete this.newRegion;
		}
	},
	setRegionId: function(regionID) {
		this.newRegion = regionID;
		if (this.rendered) {
			this._update();
		}
	}
});
Ext.reg('InfoPlant3', EQPublish.InfoPlant3);


EQPublish.ProtectedRegionInfoPanel = Ext.extend(Ext.Panel, {
	initComponent: function() {
		Ext.apply(this, {
			id: 'ProtectedRegionInfoPanel',
			autoScroll: true,
			//activeItem: 0,
			items: [
				{ id: 'tabInfo1', xtype: 'InfoPlant1' },
				{ id: 'tabInfo2', xtype: 'InfoPlant2' },
				{ id: 'tabInfo3', xtype: 'InfoPlant3' }
			],
			//width: '100%',
			autoScroll: true
		});
		EQPublish.ProtectedRegionInfoPanel.superclass.initComponent.apply(this, arguments);
	},
	setRegionId: function(regionID) {}
});
Ext.reg('ProtectedRegionInfoPanel', EQPublish.ProtectedRegionInfoPanel);



