ext.js 弹出自定义输入框

var addWin;

			  		var formPanelCf = new Ext.form.FormPanel({
			  		   autoWidth:false,
			  		   layout:"form",
			  		   frame:true,
			  		   labelWidth:200,
			  		   labelAlign:"right",
			  		   items:[{
			  		    xtype:"label",
			  		    height  : 300,
			  		    text :i18n_fld_wafer_storage_location
			  		   },{
			  		    xtype : "textfield",
			  		    inputType : 'text',
			  		    hideLabel : true,
			  		    id:"location",
			  		    anchor : "100%",
			            enableKeyEvents:true,
			            listeners: {
			              keyup: function (cmp, e){
			                if (e.getKey() == 13){
						  	    var txt = Ext.getCmp('location').getValue();
						  	    if (!isEmpty(txt)) {
						  	    if (!(txt.indexOf("RW-") != -1)) {
						  	    	showAlertByExt(i18n.labels.LBS_ERROR,i18n_msg_location_must_start_with_rw, 1);
						  	    }else{
						  	        addWin.hide();
						  	        formPanelCf.getForm().reset();
						  	        saveNewLocation(record.get('LotID'),txt);
						  	    }
						  	    }else {
						  	    	showAlertByExt(i18n.labels.LBS_ERROR,i18n_msg_location_must_start_with_rw, 1);
						  	    }
			                }
			              }
			            }
			  		   }]
			  		  });
			  		
			  		if (!addWin) {
			  	        addWin = new Ext.Window({
			  	            title:i18n_fld_updateLocation,
			  	            modal:true,
			  	            width:250,
			  	            height:200,
			  	            collapsible:false,
			  	            resizable:false,
			  	            closeAction:'hide',
			  	            //items:[formPanelCf] // 将关闭窗口动作设置为隐藏(不销毁窗口对象)
			  	            items : formPanelCf,
			  	            buttons : [{
					  	    text : i18n_msg_CONFIRM,
					  	    handler : function(){
					  	    var txt = Ext.getCmp('location').getValue();
					  	    if (!isEmpty(txt)) {
					  	    if (!(txt.indexOf("RW-") != -1)) {
					  	    	showAlertByExt(i18n.labels.LBS_ERROR,i18n_msg_location_must_start_with_rw, 1);
					  	    }else{
					  	        addWin.hide();
					  	        formPanelCf.getForm().reset();
					  	        saveNewLocation(record.get('LotID'),txt);
					  	    }
					  	    }else {
					  	    	showAlertByExt(i18n.labels.LBS_ERROR,i18n_msg_location_must_start_with_rw, 1);
					  	    }
					  	    }
					  	    
					  	   }, {
					  	    text : i18n_msg_Cancel,
					  	    handler : function(){
					  	     addWin.hide();
					  	     formPanelCf.getForm().reset();
					  	    }
					  	   }]
					  	        });
					  	    }
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值