1. #1
    Sencha Premium Member
    Join Date
    Sep 2007
    Posts
    134
    Vote Rating
    6
    Answers
    8
    tm8747a is on a distinguished road

      0  

    Default 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
    75
    Vote Rating
    12
    Answers
    4
    krullj will become famous soon enough

      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 Premium Member
    Join Date
    Sep 2007
    Posts
    134
    Vote Rating
    6
    Answers
    8
    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
    75
    Vote Rating
    12
    Answers
    4
    krullj will become famous soon enough

      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 Premium Member
    Join Date
    Sep 2007
    Posts
    134
    Vote Rating
    6
    Answers
    8
    tm8747a is on a distinguished road

      0  

    Default

    That did it, thanks!

Thread Participants: 1

Tags for this Thread