-
Ext.copyTo Missing
REQUIRED INFORMATION
Ext version tested:Browser versions tested against:DOCTYPE tested against: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: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:Operating System:
-
Thank you for the report.
-
This has been implemented for the next release.