Sencha Documentation

This singleton contains a set of validation functions that can be used to validate any type of data. They are most often used in Models, where they are automatically set up and executed.

Properties

 
The default error message used when an exclusion validation fails
The default error message used when an exclusion validation fails
 
formatMessage : Boolean
The default error message used when a format validation fails
The default error message used when a format validation fails
 
The default error message used when an inclusion validation fails
The default error message used when an inclusion validation fails
 
lengthMessage : String
The default error message used when a length validation fails
The default error message used when a length validation fails
 
The default error message used when a presence validation fails
The default error message used when a presence validation fails

Methods

 
exclusion( Object config, String value ) : Boolean
Validates that the given value is present in the configured list
Validates that the given value is present in the configured list

Parameters

  • config : Object
    Optional config object
  • value : String
    The value to validate

Returns

  • Boolean   True if the value is not present in the list
 
format( Object config, String value ) : Boolean
Returns true if the given value passes validation against the configured matcher regex
Returns true if the given value passes validation against the configured matcher regex

Parameters

  • config : Object
    Optional config object
  • value : String
    The value to validate

Returns

  • Boolean   True if the value passes the format validation
 
inclusion( String value ) : Boolean
Validates that the given value is present in the configured list
Validates that the given value is present in the configured list

Parameters

  • value : String
    The value to validate

Returns

  • Boolean   True if the value is present in the list
 
length( Object config, String value ) : Boolean
Returns true if the given value is between the configured min and max values
Returns true if the given value is between the configured min and max values

Parameters

  • config : Object
    Optional config object
  • value : String
    The value to validate

Returns

  • Boolean   True if the value passes validation
 
presence( Object config, Mixed value ) : Boolean
Validates that the given value is present
Validates that the given value is present

Parameters

  • config : Object
    Optional config object
  • value : Mixed
    The value to validate

Returns

  • Boolean   True if validation passed