Success! Looks like we've fixed this one. According to our records the fix was applied for TOUCH-1208 in a recent build.
  1. #1
    Sencha User
    Join Date
    Dec 2011
    Posts
    21
    Vote Rating
    1
    supersaiyen is on a distinguished road

      0  

    Default Ext.copyTo Missing

    Ext.copyTo Missing


    REQUIRED INFORMATION
    Ext version tested:
    • Sencha Touch 2.0.0-pr2
    Browser versions tested against:
    • Chrome
    DOCTYPE tested against:
    • html (5)
    Description:
    • When instantiating a DirectStore a type error is thrown missing the method 'copyTo'
    • Uncaught TypeError: Object #<Object> has no method 'copyTo'
      • Ext.define.constructor sencha-touch-all-debug-w-comments.js:41189
      • Ext.apply.create.Class sencha-touch-all-debug-w-comments.js:4971
      • (anonymous function) stores.js:34
    Steps to reproduce the problem:
    • Instantiate a direct store
    The result that was expected:
    • A direct store will be created.
    The result that occurs instead:
    • An exception is thrown.
    Test Case:
    Code:
      
    var directUserStore = new Ext.data.DirectStore({
            paramsAsHash: true,
            root: 'records',
            directFn: gameService.getUsers,
            autoLoad: true,
            fields: ['id', 
                     'name'
                     ]
          });
    HELPFUL INFORMATION
    Adding the copyTo method out of Ext 4 solves the problem.
    Code:
    Ext.copyTo = function(dest, source, names, usePrototypeKeys){
        if(typeof names == 'string'){
            names = names.split(/[,;\s]/);
        }
        Ext.each(names, function(name){
            if(usePrototypeKeys || source.hasOwnProperty(name)){
                dest[name] = source[name];
            }
        }, this);
        return dest;
    }
    Possible fix:
    • Add the copyTo method to the Ext static definition.
    Additional CSS used:
    • only default ext-all.css
    Operating System:
    • Mac OSX 10.7

  2. #2
    Sencha User Jamie Avins's Avatar
    Join Date
    Mar 2007
    Location
    Redwood City, California
    Posts
    3,661
    Vote Rating
    19
    Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough

      0  

    Default


    Thank you for the report.

    Sencha Inc

    Jamie Avins

    @jamieavins

  3. #3
    Sencha User Jamie Avins's Avatar
    Join Date
    Mar 2007
    Location
    Redwood City, California
    Posts
    3,661
    Vote Rating
    19
    Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough

      0  

    Default


    This has been implemented for the next release.

    Sencha Inc

    Jamie Avins

    @jamieavins

Thread Participants: 1