ExtJS 4 Custom VType

Posted By Vitaliy | February 11, 2013 | ExtJS 4.1.1
0 3349
​You should add your validation method to Ext.form.field.VTypes.
Also add "<yourvtype>Text" (e.g. uniquenameText) property to show as error message.

Js Code

Ext.apply(Ext.form.field.VTypes, {
    uniquename: function (v) {
        return Ext.form.field.VTypes.uniquenameRegex.test(v);
    },
    uniquenameRegex: /^[a-z]{1}[a-z_0-9]*$/,
    uniquenameText: 'Invalid unique name'
});