Class Index | File Index

Classes


Class M.Validator


Extends M.Object.
The prototype for every validator. All validation logic is implemented in the specific validators.
Defined in: validator.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Field Summary
Field Attributes Field Name and Description
 
The type of this object.
 
"Class-wide" array containing error objects.
Method Summary
Method Attributes Method Name and Description
 
Empties the error buffer, is done before each new validation process
 
customize(obj)
extends this.
Methods borrowed from class M.Object:
bindToCaller, create, destroy, extend, get, include, set
Class Detail
M.Validator()
Field Detail
{String} type
The type of this object.

{Array|Object} validationErrors
"Class-wide" array containing error objects. Specific validators do NOT have an own validationErrors array, but use this one to write errors to. Error object represent errors that occured during validation. E.g. error object: { msg: 'E-Mail adress not valid.', modelId: 'Task_123', property: 'email', viewId: 'm_123', validator: 'EMAIL', onSuccess: function(){proceed();} onError: function(markTextFieldError(); console.log('email not valid')}; }
Method Detail
clearErrorBuffer()
Empties the error buffer, is done before each new validation process

{Object} customize(obj)
extends this. Can be used to provide a custom error msg to a validator E.g. M.EmailValidator.customize({msg: 'Please provide a valid e-mail adress.'});
Parameters:
obj
Returns:
{Object} The customized validator.

Documentation generated by JsDoc Toolkit 2.4.0 on Wed Dec 08 2010 15:07:35 GMT+0100 (MEZ)