Wolfgang
31 Jul 2007, 11:27 AM
Hello,
i think there is a bug in handling findField in markInvalid (Ext 1.1R1):
Starting from line 23723 in ext-debug.js
findField : function(id){
var field = this.items.get(id);
if(!field){
this.items.each(function(f){
if(f.isFormField && (f.dataIndex == id || f.id == id || f.getName() == id)){
field = f;
return false;
}
});
}
return field || null;
},
markInvalid : function(errors){
if(errors instanceof Array){
for(var i = 0, len = errors.length; i < len; i++){
var fieldError = errors[i];
var f = this.findField(fieldError.id);
if(f){
f.markInvalid(fieldError.msg);
}
}
}else{
var field, id;
for(id in errors){
if(typeof errors[id] != 'function' && (field = this.findField(id))){
field.markInvalid(errors[id]);
}
}
}
return this;
},
In particular here:
var f = this.findField(fieldError.id);
findField returns a field of the current form, even when fieldError.id is undefined, but errors is set.
So what happens is, that a field of the form gets marked invalid, without having set this in errors.
Regards
Wolfgang
i think there is a bug in handling findField in markInvalid (Ext 1.1R1):
Starting from line 23723 in ext-debug.js
findField : function(id){
var field = this.items.get(id);
if(!field){
this.items.each(function(f){
if(f.isFormField && (f.dataIndex == id || f.id == id || f.getName() == id)){
field = f;
return false;
}
});
}
return field || null;
},
markInvalid : function(errors){
if(errors instanceof Array){
for(var i = 0, len = errors.length; i < len; i++){
var fieldError = errors[i];
var f = this.findField(fieldError.id);
if(f){
f.markInvalid(fieldError.msg);
}
}
}else{
var field, id;
for(id in errors){
if(typeof errors[id] != 'function' && (field = this.findField(id))){
field.markInvalid(errors[id]);
}
}
}
return this;
},
In particular here:
var f = this.findField(fieldError.id);
findField returns a field of the current form, even when fieldError.id is undefined, but errors is set.
So what happens is, that a field of the form gets marked invalid, without having set this in errors.
Regards
Wolfgang