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();
}
}]
});
}