Class Index | File Index

Classes


Class M.PresenceValidator


Extends M.Validator.
Validates if value is existing. Used, e.g. for every property in a model record that is marked as 'required' (M.Model#isRequired.
Defined in: presence_validator.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Field Summary
Field Attributes Field Name and Description
 
The type of this object.
Fields borrowed from class M.Validator:
validationErrors
Method Summary
Method Attributes Method Name and Description
 
validate(obj, key)
Validation method.
Methods borrowed from class M.Validator:
clearErrorBuffer, customize
Methods borrowed from class M.Object:
bindToCaller, create, destroy, extend, get, include, set
Class Detail
M.PresenceValidator()
Field Detail
{String} type
The type of this object.
Method Detail
{Boolean} validate(obj, key)
Validation method. First checks if value is not null, undefined or an empty string and then tries to create a M.Date with it. Pushes different validation errors depending on where the validator is used: in the view or in the model.
Parameters:
{Object} obj
Parameter object. Contains the value to be validated, the M.ModelAttribute object of the property and the model record's id.
{String} key
Returns:
{Boolean} Indicating whether validation passed (YES|true) or not (NO|false).

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