Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

  1. #1
    Sencha User
    Join Date
    Mar 2012
    Posts
    35
    Vote Rating
    0
    Patlatus is on a distinguished road

      0  

    Default Is it possible to override a mixin?

    Is it possible to override a mixin?


    I am trying to override this class to validate only fields where values where changed.


    Code:
    Ext.define('TreX.overrides.OverrideFieldField', {
           override : 'Ext.form.field.Field',
           
           validate : function() {
              var me = this,
                  preValue = me.previousRawValue,
                  isValid,
                  validate;
              me.previousRawValue = me.getRawValue();
              validate = (preValue !== me.previousRawValue || me.wasValid === undefined);
              isValid = validate ? me.isValid() : me.wasValid;
              if (isValid !== me.wasValid) {
                  me.wasValid = isValid;
                  me.fireEvent('validitychange', me, isValid);
              }
              return isValid;
          }
        });

    However, it seems ExtJS calls not overriden function but old function from Ext.form.field.Field.
    Is it possible to override mixins at all?
    It seems there were similar threads
    http://www.sencha.com/forum/showthread.php?258138
    http://www.sencha.com/forum/showthread.php?178997
    but when I try to open them I see message
    Patlatus, you do not have permission to access this page. This could be due to one of several reasons:
    1. Your user account may not have sufficient privileges to access this page. Are you trying to edit someone else's post, access administrative features or some other privileged system?
    2. If you are trying to post, the administrator may have disabled your account, or it may be awaiting activation.

  2. #2
    Sencha Premium Member
    Join Date
    Nov 2011
    Posts
    72
    Vote Rating
    13
    eric.cook will become famous soon enough

      0  

    Default Overriding mixins

    Overriding mixins


    You can technically override a mixin at any point, but changes only affect classes that are mixed after the override. The problem is that functions in the mixin aren't referenced from the mixin class, they are copied into the target class. Once copied, there's no further dependency on the mixin.

    You should override methods on the target class itself. For example, instead of trying to override the validate method on Ext.form.field.Field, you might override the validate method on Ext.form.field.Text.

  3. #3
    Sencha User
    Join Date
    Mar 2012
    Posts
    35
    Vote Rating
    0
    Patlatus is on a distinguished road

      0  

    Default


    Quote Originally Posted by eric.cook View Post
    You can technically override a mixin at any point, but changes only affect classes that are mixed after the override. The problem is that functions in the mixin aren't referenced from the mixin class, they are copied into the target class. Once copied, there's no further dependency on the mixin.

    You should override methods on the target class itself. For example, instead of trying to override the validate method on Ext.form.field.Field, you might override the validate method on Ext.form.field.Text.
    Yes, but assume if mixin used in over 9000 classes, then you will have to make over 9000 overrides inside target classes.
    Thanks to God, that there are only four classes in ExtJS library mixing-in this mixin.

Thread Participants: 1

Tags for this Thread