-/*!
- * Ext JS Library 3.3.1
- * Copyright(c) 2006-2010 Sencha Inc.
- * licensing@sencha.com
- * http://www.sencha.com/license
- */
/**
- * @class Ext.form.VTypes
+ * @class Ext.form.field.VTypes
* <p>This is a singleton object which contains a set of commonly used field validation functions.
* The validations provided are basic and intended to be easily customizable and extended.</p>
- * <p>To add custom VTypes specify the <code>{@link Ext.form.TextField#vtype vtype}</code> validation
+ * <p>To add custom VTypes specify the <code>{@link Ext.form.field.Text#vtype vtype}</code> validation
* test function, and optionally specify any corresponding error text to display and any keystroke
* filtering mask to apply. For example:</p>
* <pre><code>
// custom Vtype for vtype:'time'
var timeTest = /^([1-9]|1[0-9]):([0-5][0-9])(\s[a|p]m)$/i;
-Ext.apply(Ext.form.VTypes, {
+Ext.apply(Ext.form.field.VTypes, {
// vtype validation function
time: function(val, field) {
return timeTest.test(val);
* Another example:
* <pre><code>
// custom Vtype for vtype:'IPAddress'
-Ext.apply(Ext.form.VTypes, {
+Ext.apply(Ext.form.field.VTypes, {
IPAddress: function(v) {
return /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(v);
},
* </code></pre>
* @singleton
*/
-Ext.form.VTypes = function(){
+Ext.define('Ext.form.field.VTypes', (function(){
// closure these in so they are only created once.
var alpha = /^[a-zA-Z_]+$/,
alphanum = /^[a-zA-Z0-9_]+$/,
// All these messages and functions are configurable
return {
+ singleton: true,
+ alternateClassName: 'Ext.form.VTypes',
+
/**
* The function used to validate email addresses. Note that this is a very basic validation -- complete
* validation per the email RFC specifications is very complex and beyond the scope of this class, although
*/
'alphanumMask' : /[a-z0-9_]/i
};
-}();
+})());