Success! Looks like we've fixed this one. According to our records the fix was applied for DSGNR-1956 in a recent build.
  1. #1
    Ext JS Premium Member
    Join Date
    Apr 2011
    Location
    London, UK
    Posts
    32
    Vote Rating
    1
    markofsine is on a distinguished road

      1  

    Default Mixins property is not available and cannot be added

    Mixins property is not available and cannot be added


    How can the mixins property be added to a class?

    It currently does not exist in Component Config and cannot be added as the 'Add' function only adds string values and not object or array.

    Thanks.

  2. #2
    Ext JS Premium Member
    Join Date
    May 2010
    Posts
    3
    Vote Rating
    0
    crispthinking is on a distinguished road

      0  

    Default


    We're also in need of this. Any idea if this is on the roadmap, or why it's not possible?

  3. #3
    Touch Premium Member
    Join Date
    Aug 2011
    Posts
    96
    Vote Rating
    6
    abcoa is on a distinguished road

      0  

    Default


    Yes - this is very much needed!

  4. #4
    Sencha Premium Member
    Join Date
    Dec 2009
    Location
    Rhode Island
    Posts
    231
    Vote Rating
    23
    dmulcahey will become famous soon enough dmulcahey will become famous soon enough

      0  

    Default


    If you supply a value when you add the custom option it may work... Ex:

    Type in: mixins:['something']
    Then click "add"

  5. #5
    Touch Premium Member
    Join Date
    Aug 2011
    Posts
    96
    Vote Rating
    6
    abcoa is on a distinguished road

      0  

    Default


    Quote Originally Posted by dmulcahey View Post
    If you supply a value when you add the custom option it may work... Ex:

    Type in: mixins:['something']
    Then click "add"
    That didn't work...
    You get a message "A custom config cannot override a reserved member"

  6. #6
    Sencha Premium Member
    Join Date
    Dec 2009
    Location
    Rhode Island
    Posts
    231
    Vote Rating
    23
    dmulcahey will become famous soon enough dmulcahey will become famous soon enough

      0  

    Default


    Gotcha. You could probably use an override to take care of it in that case. But the method described above will let you control the type of custom properties that aren't reserved.

  7. #7
    Touch Premium Member
    Join Date
    Aug 2011
    Posts
    96
    Vote Rating
    6
    abcoa is on a distinguished road

      1  

    Default


    Quote Originally Posted by dmulcahey View Post
    Gotcha. You could probably use an override to take care of it in that case. But the method described above will let you control the type of custom properties that aren't reserved.
    That is true but at the same time there are so many 'restrictions' in SA 2 that I find my self writing overrides constantly....
    • Can't add mixins, override
    • Can't use variable name where SA 2 expects a number, override (e.g. Store where pageSize is variable)
    • Can't mess with constructor, override
    • Can't add feature to your grid, override

    I know Sencha is aware of these issues with SA 2 and (I am hoping) they will address them, but for now, using SA 2 for more complex apps is a bit of a struggle...

  8. #8
    Touch Premium Member pmarko's Avatar
    Join Date
    Dec 2007
    Location
    Ireland
    Posts
    57
    Vote Rating
    1
    pmarko is on a distinguished road

      0  

    Default


    +1

  9. #9
    Touch Premium Member JoelRSimpson's Avatar
    Join Date
    Jun 2009
    Location
    Seattle, WA USA
    Posts
    52
    Vote Rating
    1
    JoelRSimpson is on a distinguished road

      0  

    Question Mixins via Override?

    Mixins via Override?


    I'm trying to add mixins via an override so that I can create functionality similar to the ImageViewer example (my app is a workflow engine, the icons are workflow nodes). I have not found a way to successfully add the mixins definition.
    Code:
        
    mixins: {        dragSelector: 'Ext.ux.DataView.DragSelector',
            draggable   : 'Ext.ux.DataView.Draggable'
        },
    I'm starting to understand that this might be an order of events kind of problem, and might not be possible currently, but it's very frustrating that adding these to the generated class by hand makes everything work just fine. If architect simply had a standard field that would allow me to specify the array it would be enough.

    Does anyone know how to add mixins via an override? I've tried many different ways and if they do get added, it replaces the other mixins rather than adding them.

  10. #10
    Sencha User
    Join Date
    Oct 2011
    Location
    Germany
    Posts
    50
    Vote Rating
    10
    apsq will become famous soon enough

      0  

    Default


    This may be a bit late, but: it's impossible to add mixins in an override because mixins are resolved on definition rather than on instantiation (they're not part of the configuration, they're part of the definition itself).

    The only way to override mixins is by adding an internal property (say, 'x-mixins') and overriding Ext.define to parse that property and add any mixins to the mixin property before doing the regular Ext.define dance. Because SA2 helpfully (*cough*) throws all non-scalar values in the initComponent method rather than the definition, the internal property needs to be a string rather than an array. I've used a comma as separator and just call split() on the value to turn it into an array, but you may find other approaches useful (worst case: enter JavaScript code that you want to be eval'ed; not-so-bad case: use JSON).