Extjs form提交时间段,监听时间控件的select事件

DateForm = Ext.extend(Ext.ux.Form,{
	taskIds:[], //存放批量任务
	constructor: function(){
		this.dateStart = this.createDateField('<font color="red">*</font>开始日期',
				'dateStart','Ymd', '95%');
		this.dateEnd = this.createDateField('<font color="red">*</font>结束日期','dateEnd','Ymd', '95%');
//		var paramPk =[{'id':'0', 'name':'0'},{'id':'1', 'name':'1'}];
		this.paramPk = this.createMemoryCombo('PK值','id','name','95%',paramPk, 'paramPk');//自定义下拉框值
        this.paramPk.allowBlank = false;
        this.paramPk.store.load();
		this.dateStart.setMaxValue(new Date());
		this.dateEnd.setMaxValue(new Date());
		this.dateStart.on('select',function(e){
			var beginTime = taskGrid.dateWindow.dateForm.dateStart.getValue().format("Y-m-d");
			taskGrid.dateWindow.dateForm.dateEnd.setMinValue(beginTime);
		});
		this.dateEnd.on('select',function(e){
			var endTime = taskGrid.dateWindow.dateForm.dateEnd.getValue().format("Y-m-d");
			taskGrid.dateWindow.dateForm.dateStart.setMaxValue(endTime);
		});
		this.dateStart.allowBlank = false;
		this.dateEnd.allowBlank = false;
		DateForm.superclass.constructor.call(this, {
	            anchor: '90%',
	            autoHeight:true,
	            labelWidth: 60,
	            labelAlign :'right',
	            frame: true,
	            bodyStyle:"padding: 3px 3px 0",
	            layout: 'tableform',
	            layoutConfig: {columns:3},
	            items:[		
	                this.dateStart,this.dateEnd,this.paramPk
	            ],
	            buttonAlign :'center',
	            buttons: [
	               {text: '确定', width: 20,iconCls: 'save', hidden: false,handler:this.DateFormClick,scope:this},
	               {text: '关闭', width: 20,iconCls:'delete', handler: this.onCloseClick, scope: this}
	            ]
	        });
	},
	DateFormClick:function(){
//		var taskId = this.taskId.getValue();
//		var dateStr = this.date_.getValue();
		var paramPk = this.paramPk.getValue();
		if(this.getForm().isValid()){
			this.getForm().submit({
				waitMsg: '正在提交数据...',
				url: '/etl/task/doEtlTaskSched',
				method: 'POST',
		 		params:{taskIds:this.taskIds,paramPk:paramPk},
				success: function(form,action){
					Ext.MessageBox.alert("系统提示:",BLANKSTR+"添加成功!"+BLANKSTR);
//					this.dateWindow().ownerCt.hide();
				},
				failure: function(form,action){
					Ext.MessageBox.alert("系统提示:",BLANKSTR+"添加失败!"+BLANKSTR);
					this.getForm().ownerCt.hide();
				}
			});
		}
	},
	onCloseClick:function(){
		 this.ownerCt.hide();
	}
	
});
	/******************Java后台接收*************************/
	@RequestMapping(value = "/doEtlTaskSched", method = RequestMethod.POST)
	@ResponseBody
	public ResponseData doEtlTaskSched(Integer[] taskIds, String dateStart,String dateEnd,Integer paramPk) {
		taskSchedService.doEtlTaskSched(taskIds, dateStart,dateEnd,paramPk);
		return ResponseData.SUCCESS_NO_DATA;
	}



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值