-
9 Dec 2011 5:35 AM #1
Ext.copyTo Missing
Ext.copyTo Missing
REQUIRED INFORMATION
Ext version tested:- Sencha Touch 2.0.0-pr2
- Chrome
- html (5)
- 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
- Instantiate a direct store
- A direct store will be created.
- An exception is thrown.
HELPFUL INFORMATIONCode:var directUserStore = new Ext.data.DirectStore({ paramsAsHash: true, root: 'records', directFn: gameService.getUsers, autoLoad: true, fields: ['id', 'name' ] });
Adding the copyTo method out of Ext 4 solves the problem.
Possible fix: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; }- Add the copyTo method to the Ext static definition.
- only default ext-all.css
- Mac OSX 10.7
-
9 Dec 2011 8:27 AM #2Sencha - Sencha Touch Dev Team
- Join Date
- Mar 2007
- Location
- Redwood City, California
- Posts
- 3,652
- Vote Rating
- 14
Thank you for the report.
-
14 Dec 2011 10:33 AM #3Sencha - Sencha Touch Dev Team
- Join Date
- Mar 2007
- Location
- Redwood City, California
- Posts
- 3,652
- Vote Rating
- 14
This has been implemented for the next release.
Success! Looks like we've fixed this one. According to our records the fix was applied for
TOUCH-1208
in
2.0.


Reply With Quote