Results 1 to 2 of 2

Thread: [4.1] 'Ext.app.Controller.addRef - modify to accept arrays

    Success! Looks like we've fixed this one. According to our records the fix was applied for EXTJS-6672 in a recent build.
  1. #1
    Sencha Premium User
    Join Date
    Nov 2010
    Location
    Chicago
    Posts
    1,934
    Vote Rating
    548
      0  

    Default [4.1] 'Ext.app.Controller.addRef - modify to accept arrays

    The public (but undocumented) Ext.app.Controller.addRef method currently accepts a single reference object, but it could also accept an array of such references by not converting the ref param to an array. There's no need to convert the param to an array since the ref method will do this conversion by calling Ext.Array.from(refs).

    Code:
    Ext.define('Ext.app.Controller', {
        ....
        ref: function(refs) {
            refs = Ext.Array.from(refs);
            
            ...
        },
    
        addRef: function(ref) {
            return this.ref([ref]); // <-- skip [] around ref and rename ref to refs
        },
        ....
    EDIT
    Also, the addRef method should not return this.ref since the ref method doesn't return a value, so just skip return. Basically, addRef would be an alias for the ref method
    Last edited by LesJ; 27 Jun 2012 at 10:59 AM. Reason: Don't return a value from addRef

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Vote Rating
    1272
      0  

    Default

    Thanks for the report.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •