PDA

View Full Version : Getting "too much recursion" error for my form, but why?



tboerger
26 Nov 2010, 2:52 AM
Hi folks,

im getting an "too much recursion" error if i'm adding a special vtype to my date fields. I hope you can help me to find the problem...


too much recursion
var errors = Ext.form.TextField.superclass.getErrors.apply(this, arguments);

I have added the custom vtype for dateranges out of the examples page. If i'm adding a new plain record, the form works fine. If i'm editing an existing one i'm getting the above error.


Ext.apply(Ext.form.VTypes, {
daterange : function(val, field) {
var date = field.parseDate(val);

if(!date){
return false;
}
if (field.startDateField && (!this.dateRangeMax || (date.getTime() != this.dateRangeMax.getTime()))) {
var start = Ext.getCmp(field.startDateField);
start.setMaxValue(date);
start.validate();
this.dateRangeMax = date;
}
else if (field.endDateField && (!this.dateRangeMin || (date.getTime() != this.dateRangeMin.getTime()))) {
var end = Ext.getCmp(field.endDateField);
end.setMinValue(date);
end.validate();
this.dateRangeMin = date;
}
/*
* Always return true since we're only using this vtype to set the
* min/max allowed values (these are tested for after the vtype test)
*/
return true;
}
});