You can use functions instead of properties, then you can just call them:
Ext.apply(Ext.form.VTypes, { // Validates an ajax thingy ajax: function(v) { // validate against email VType return Ext.form.VTypes.email(v); }, // Override the default Ext function, to allow oddly-placed hyphens email: function(v) { var regex = /^[-\w][-+\.\w]*@[-\w\.]+\.[A-Za-z]{2,4}$/; return regex.test(v); } } Ext.form.VTypes.ajax(' abc@de.ce ');
source share