PDA

View Full Version : [OPEN] Model Format Validations - no matcher or message properties



darrylm
23 Mar 2012, 3:08 AM
I've added a format validation to a model that requires a regex to be entered.

The format validation object does not have properties for matcher or message - so I have added them. But when I enter the regex it as single quotes around the regex - which is not what is required for the matcher.

Anyone know how to get around this?

Here is the generated code in designer:


Ext.define('myPoliBot.store.MyFormatValidation', { extend: '',


config: {
type: 'format',
field: 'email',
matcher: '/^(([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+){0,1}$/',
message: 'must be a valid email for us'
}
});

BTW - have used the email validation object - but this seems to also imply a presence validation on email field when it is left blank.

dmulcahey
13 May 2012, 8:49 AM
- bump

Does anyone have any info on this? I am running into the same thing.