Ext.apply(Ext.form.field.VTypes, {
//判断输入的值是否在对应的store中
inputValueRange : function(value, field) {
var index = field.store.findExact(field.displayField,value,0,false,true,true);
if(index == -1){
return false;
}
return true;
},
inputValueRangeText : "所输入的值非法!"
});
如上,为判断输入的值是否在对应的store中,使用vtype:inputValueRange,来实现这个验证,通过vtypeText:""来改变默认的提示。
可根据需要扩展自己需要的验证方法