Results 1 to 4 of 4

Thread: Unable to override validateOnChange of Form Field

  1. #1
    Sencha Premium Member
    Join Date
    Apr 2015
    Posts
    122
    Answers
    10

    Default Answered: Unable to override validateOnChange of Form Field

    Hi there,

    I would like to override Ext.form.field.Field's validateOnChange property. For that I have created a file under overrides/classic/src/form/field/Field.js with the following content:

    Code:
    Ext.define('MyApp.overrides.classic.src.form.field.Field',
    {
        override : 'Ext.form.field.Field',    validateOnChange : false, 
        
        initComponent : function()
        {
            this.validateOnChange = false;
            console.log('creating field');
            this.callParent(arguments);
        }
    });
    The value doesn't get picked by my fields and the console does not show up, what am I doing wrong?

    Same case in a fiddle: https://fiddle.sencha.com/#fiddle/17hp

    We have an override for a custom class in overrides/classic/src/form/MyForm.js and that gets picked, what's going wrong with this?

    Thanks in advance

  2. Hi--

    Ext.form.field.Field is just a mixin, so the override won't be applied. Can you add the override on Ext.form.field.Base?

    Thanks!
    Joel

  3. #2
    Sencha User joel.watson's Avatar
    Join Date
    Nov 2014
    Posts
    3,120
    Answers
    446

    Default

    Hi--

    Ext.form.field.Field is just a mixin, so the override won't be applied. Can you add the override on Ext.form.field.Base?

    Thanks!
    Joel

  4. #3
    Sencha Premium Member
    Join Date
    Apr 2015
    Posts
    122
    Answers
    10

    Default

    Ahh, I totally overlooked it. I had the same problem in the past with Labelable. Thanks Joel!

  5. #4
    Sencha User joel.watson's Avatar
    Join Date
    Nov 2014
    Posts
    3,120
    Answers
    446

    Default

    Quote Originally Posted by A. Llorente View Post
    Ahh, I totally overlooked it. I had the same problem in the past with Labelable. Thanks Joel!
    Sure thing, glad it was helpful!

    Thanks
    Joel

Similar Threads

  1. File form field override button tooltip?
    By toxkillfraex in forum Ext: Q&A
    Replies: 4
    Last Post: 17 Sep 2016, 8:59 AM
  2. form.Field Override
    By dorgan in forum Ext 3.x: User Extensions and Plugins
    Replies: 1
    Last Post: 30 Dec 2011, 11:08 AM
  3. Ext.form.Field override : Adding an icon to a form field of any type
    By arnold in forum Ext 2.x: User Extensions and Plugins
    Replies: 2
    Last Post: 25 Mar 2011, 6:41 AM
  4. Override Form Layout Field Template
    By sci236 in forum Ext 1.x: Help & Discussion
    Replies: 0
    Last Post: 15 May 2007, 5:23 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •