Results 1 to 4 of 4

Thread: mixin life cycle - need more docs

  1. #1
    Sencha User
    Join Date
    Nov 2010
    Posts
    448

    Default mixin life cycle - need more docs

    the class system mixins tutorial is very dull. it does not state if the mixins have a constructor/initialize functions (I think they don't) even though they are defined as objects.
    the example in the docs are too plain and do not explain the subject in depth.
    thanks.

  2. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,379

    Default

    A mixin isn't really created. Ext.Base takes the prototype of the mixins and merges it onto the class you are using it on. If there is a method/property on the mixin that is already on the class, the item on the mixin will not be merged on the class so if you have a constructor method on the mixin it won't overwrite the one on the class.

    So the methods are then available to the scope of the class or you can execute the methods on the mixin itself via this.mixins.mixinname.method.call(this);
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

  3. #3
    Sencha User
    Join Date
    Nov 2010
    Posts
    448

    Default

    got it. thanks!

  4. #4
    Sencha User
    Join Date
    Jul 2016
    Posts
    38

    Default

    When merging process starts? I've overridden one of the methods of Mixin, but it hasn't been overrode in target class. So I assume that merging goes before overriding. If it is true, how to override mixins method properly?

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
  •