reservcenter.js

来自「一个使用ssh+ext的例子。 希望对开发这个应用的人带来好处。仔细研究里面的」· JavaScript 代码 · 共 101 行

JS
101
字号
Ext.namespace("Neo");
Ext.namespace("Neo.frontdesk");

Neo.frontdesk.ReservCenter = Ext.extend(Ext.Panel,{
	layout:'border'
	,initComponent: function(){
		Ext.apply (this,{
			items:[
				{
					region:'center'
					//,xtype:'panel'
					//,collapsible:false
					,margins:'5 0 0 0'
					,layout:'fit'
					,items:[
						{
							xtype:'tabpanel'
							,border:false
							,activeTab:0
							,tabPosition:'top'
							//,autoHeight:true
							,layoutOnTabChange:true
							,defaults:{autoScroll: true}
							,items:[
								{
									xtype:'reservsummary'
									,id:'reservSummary'
								}
								,{
									xtype:'reservmanage'
									,id:'reservManage'
								}
							]
						}
					]
				},
				{
					xtype:'reservinfo'
					,id:'reservInfo'
					,region:'north'
					,height:260
					,title:'预定信息'
					,collapsible:true
					,collapseFirst: false
					,minSize: 50
		       		,maxSize: 260
		       		,split:true
				}
			]
		});
		Neo.frontdesk.ReservCenter.superclass.initComponent.apply(this,arguments);
		this.reservSummary=Ext.getCmp('reservSummary');
		this.reservSummary.on({'dbclickavailroom':this.onSelectRoom
			,scope:this});
		this.reservInfo=Ext.getCmp('reservInfo');
		this.reservInfo.on({'updateItem':this.onUpdateItem
			,scope:this});
		this.reservInfo.on({'reservIn':this.onReservIn
			,scope:this});
		this.reservManage=Ext.getCmp('reservManage');
		this.reservManage.on({'loadReservInfo':this.onLoadReservInfo
			,scope:this});
		this.reservManage.on({'alertReservInfo':this.onAlertReservInfo
			,scope:this});
		this.reservManage.on({'deleteReservInfo':this.onDeleteReservInfo
			,scope:this});
		this.addEvents({'reservIn':true});
	}
	,onRender:function(){
			Neo.frontdesk.ReservCenter.superclass.onRender.apply(this,arguments);
	}
	,onAlertReservInfo:function(){
		this.reservInfo.onAlertReservBtnClick();
	}
	,onDeleteReservInfo:function(){
		//重置
		this.reservInfo.onResetBtnClick();
	}
	,onLoadReservInfo:function(selOrderRecord){
		this.reservInfo.infoState='loadReserv';
		this.reservInfo.setFormItemsDisable(true);
		this.reservInfo.saveReservBtn.disable();
		this.reservInfo.alertReservBtn.enable();
		this.reservInfo.resetBtn.enable();
		this.reservInfo.reservInBtn.enable();
		this.reservInfo.loadReservInfo(selOrderRecord);
	}
	,onReservIn:function(reservOrderId){
		this.fireEvent('reservIn',reservOrderId);
	}
	,onSelectRoom:function(selRoomRecord){
		if(this.reservInfo.reservItemGrid.disabled==false)
			this.reservInfo.addReservItem(selRoomRecord);
	}
	,onUpdateItem:function(){
		this.reservSummary.updateAvailRooms();
		this.reservManage.updateAvailItem();
	}
});
Ext.reg('reservcenter',Neo.frontdesk.ReservCenter);

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?