-
31 Jan 2012 3:18 PM #1
Model.load() broken in PR4 - fix provided
Model.load() broken in PR4 - fix provided
REQUIRED INFORMATION
Ext version tested:- ST2 PR4
- Chrome current
- html
- Calling the Ext.data.Model.load() method gives an error about model not found
- Run doc example for Model:
- No errors and my model should return my new record/call proxy if needed
Test Case:Code:Uncaught Error: [ERROR][Ext.data.Operation#setModel] An Operation needs to have a model defined
Fix:Code:MyApp.User = Ext.define('User', { extend: 'Ext.data.Model', fields: [ {name: 'id', type: 'int'}, {name: 'name', type: 'string'} ] }); MyApp.User.load(10, { scope: this, failure: function(record, operation) { //do something if the load failed }, success: function(record, operation) { //do something if the load succeeded }, callback: function(record, operation) { //do something whether the load succeeded or failed } });
Ext.data.Model.load() needs to pass the model the operation
Code:Ext.define('Ext.data.Model', { ... load: function(id, config) { config = Ext.apply({}, config); config = Ext.applyIf(config, { model: this, //this line is necessary action: 'read', params: { id: id } });
-
31 Jan 2012 3:24 PM #2Sencha - Sencha Touch Dev Team
- Join Date
- Mar 2007
- Location
- Redwood City, California
- Posts
- 3,652
- Vote Rating
- 14
This is an issue that is fixed in the next release. Thank you for the override though

This issue has been fixed for the next release!


Reply With Quote