{
xtype: 'textfield',
fieldLabel: 'Field',
allowBlank: false,
textValid: false,
validator: function(){
return this.textValid;
},
listeners : {
'change': function(textfield,newValue,oldValue) {
Ext.Ajax.request({
url: 'psc/validate',
params: { psc: value },
scope: textfield,
success: function(response){
if (response.responseText){
this.clearInvalid();
this.textValid = true;
} else {
this.markInvalid('field is not valid');
this.textValid = false;
}
}
});
}
}
}
如上,设置在changge时ajax去后台查询数据验证。
extjs 重复验证
最新推荐文章于 2021-08-05 22:16:08 发布