xtype : 'textfield',
id : 'processName',
name : 'processName',
fieldLabel : '服务名称',
labelWidth : 70,
width : 400,
allowBlank : false,
blankText : '不能为空',
validateOnChange : false,
textValid : true, // 默认校验通过
validator: function(){
return this.textValid;
},
listeners : {
'blur': function(textfield) {
Ext.Ajax.request({
url: '/service/checkNameInUse',
async: false, // 同步校验
scope: textfield,
params:{
'value': value
},
success: function(res) {
if(res.responseText == 'true'){
this.markInvalid("名称已经被使用!");
this.textValid = false;
} else {
this.clearInvalid();
this.textValid = true;
}
}
});
}
}