ExtJs 4.2.4在自定义验证器中有效:未捕获范围错误:超过最大调用堆栈大小

ExtJs 4.2.4在自定义验证器中有效:未捕获范围错误:超过最大调用堆栈大小,extjs,Extjs,我的“编辑器”字段有自定义验证器。在那里,我想检查这个字段是否有效,还需要检查我的字段是否彼此等效。但是当我在我的验证器中添加这个.confirmationEditor.isValid()时,我得到了一个错误:“uncaughtrangeError:超过了最大调用堆栈大小” 您只需使用this.confirmationEditor.isValid()无限次地调用confirmationEditor函数即可 Ext.form.field.Text的配置 在字段验证期间调用的自定义验证函数(getE

我的“编辑器”字段有自定义验证器。在那里,我想检查这个字段是否有效,还需要检查我的字段是否彼此等效。但是当我在我的验证器中添加这个.confirmationEditor.isValid()时,我得到了一个错误:“uncaughtrangeError:超过了最大调用堆栈大小”


您只需使用
this.confirmationEditor.isValid()
无限次地调用
confirmationEditor
函数即可

Ext.form.field.Text的配置

在字段验证期间调用的自定义验证函数(getErrors)


方法,您只需使用
this.confirmationEditor.isValid()
无限调用
confirmationEditor
函数即可

Ext.form.field.Text的配置

在字段验证期间调用的自定义验证函数(getErrors)

在中调用的方法

 Ext.define('My.view.common.MyPanelBase', {
    extend: 'Ext.Panel',

    constructor: function (config) {
        if (config) {
            Ext.applyIf(config.editorConfig, {allowBlank: false,
        maskRe: /[0-9]/,
        regex: /^[0-9]+$/,
        enforceMaxLength: true,
        maxLength: 6,
        anchor: '95%',
        inputType: 'password'});
        }
        Ext.apply(this.config, config);
        this.initializeEditors();
        this.initConfig();
    },

    initializeEditors: function () {
        this.editor = Ext.create('Ext.My.TextField', Ext.apply(this.config.editorConfig, {
            validator: this.editorValidator.bind(this),
            fieldLabel: this.config.editorLabel
        }));
        this.confirmationEditor = Ext.create('Ext.My.TextField', Ext.apply(this.config.editorConfig, {
            validator: this.confirmationEditorValidator.bind(this),
            fieldLabel: this.config.confirmationEditorLabel
        }));
    },

    confirmationEditorValidator: function () {
       //here I get the error
        return this.confirmationEditor.isValid() && this.compareFields();
    },

    compareFields: function () {
        return //some logic
    }
});