1. #1
    Sencha User
    Join Date
    Sep 2007
    Posts
    101
    Vote Rating
    3
    Answers
    7
    tm8747a is on a distinguished road

      0  

    Default Answered: Setting a default msgTarget for the application

    Answered: Setting a default msgTarget for the application


    I'm trying to set a default msgTarget for all the fields in my application and haven't had any success. I thought that something like this before my application.js would do it:
    Code:
    Ext.override(Ext.form.Labelable, {
        msgTarget: 'under'
    });
    But that doesn't work. Any ideas?

  2. Figured it out. If you override the class that inherits the Labelable mixin, it works fine.
    Code:
    Ext.define('MyOverride', {
      override: 'Ext.form.field.Base',
      msgTarget: 'under'
    });

  3. #2
    Sencha Premium Member krullj's Avatar
    Join Date
    Sep 2011
    Posts
    36
    Vote Rating
    7
    Answers
    2
    krullj is on a distinguished road

      0  

    Default


    Honestly, it looks like it should work, but you may want to try the newer format (and make absolutely sure that your override is being applied).

    Just to be safe, try this format, adjusting the class name as necessary:
    Code:
    Ext.define('MyApp.override.Labelable', {
      override: 'Ext.form.Labelable',
      msgTarget: 'under'
    });

  4. #3
    Sencha User
    Join Date
    Sep 2007
    Posts
    101
    Vote Rating
    3
    Answers
    7
    tm8747a is on a distinguished road

      0  

    Default


    That doesn't work either. Weird. Still trying to figure this one out.

  5. #4
    Sencha Premium Member krullj's Avatar
    Join Date
    Sep 2011
    Posts
    36
    Vote Rating
    7
    Answers
    2
    krullj is on a distinguished road

      0  

    Default


    Figured it out. If you override the class that inherits the Labelable mixin, it works fine.
    Code:
    Ext.define('MyOverride', {
      override: 'Ext.form.field.Base',
      msgTarget: 'under'
    });

  6. #5
    Sencha User
    Join Date
    Sep 2007
    Posts
    101
    Vote Rating
    3
    Answers
    7
    tm8747a is on a distinguished road

      0  

    Default


    That did it, thanks!

Thread Participants: 1

Tags for this Thread