1. #1
    Sencha Premium Member
    Join Date
    Feb 2012
    Posts
    276
    Vote Rating
    11
    worthlutz is on a distinguished road

      0  

    Default Using mixins in Architect?

    Using mixins in Architect?


    I am trying to use some mixin classes in Architect and am confused. Maybe I'm going about it the wrong way.

    I found the "class" in the toolbox and created a class with some methods to use as a mixin.

    Then in the view where I wanted to use the mixins, I put the class name:

    Code:
      mixins: 'MyMixins'
    This did not work as the mixins could not be found.
    I had to use:
    Code:
      mixins: 'app/view/MyMixins'
    It would seem that a mixins directory would be an appropriate place for these classes and then they could be found automatically. Or something like that.

    In any case, how would I create a mixin and define it using architect?

    Thanks,
    Worth

  2. #2
    Sencha - Architect Dev Team jjohnston's Avatar
    Join Date
    Sep 2010
    Posts
    539
    Vote Rating
    19
    jjohnston will become famous soon enough jjohnston will become famous soon enough

      0  

    Default


    Mixins must reference the fully qualified class name of the mixin class.

    mixins: ['MyApp.view.MyMixin']
    Jason Johnston
    @lojjic
    Sencha Architect Development Team

  3. #3
    Sencha Premium Member
    Join Date
    Feb 2012
    Posts
    276
    Vote Rating
    11
    worthlutz is on a distinguished road

      0  

    Default


    Quote Originally Posted by jjohnston View Post
    Mixins must reference the fully qualified class name of the mixin class.

    mixins: ['MyApp.view.MyMixin']

    It is not helpful that "MyApp" is required here. If I have a component saved in the toolbox and want to use it again in another app I have to edit it to change the mixin line.

    I'd like to just drag the mixin class to the Project Inspector and the class which uses it and go on. Having to edit all these saved classes just to change the appName seems a waste of time and place where mistakes will also waste time trying to find them.

    I hope that a easier solution is invented.

    Worth

  4. #4
    Sencha - Architect Dev Team jjohnston's Avatar
    Join Date
    Sep 2010
    Posts
    539
    Vote Rating
    19
    jjohnston will become famous soon enough jjohnston will become famous soon enough

      0  

    Default


    Agreed, this can definitely be made better.
    Jason Johnston
    @lojjic
    Sencha Architect Development Team

Thread Participants: 1