-
5 Mar 2011 5:38 AM #1
[CLOSED]Error in Ext.data.Model.load ?
[CLOSED]Error in Ext.data.Model.load ?
There seems to be an error in the Ext.data.Model.load method. The --> marked line of the source below throws an exception because operation.getRecords() does not return an error.
Reason: My backend returned a 404 error because I had an error in URL mapping at server side.
Because of the exception my failure method where I normally react to such server errors is never called.
PHP Code:load: function(id, config) {
config = Ext.applyIf(config || {}, {
action: 'read',
id : id
});
var operation = Ext.create('Ext.data.Operation', config),
callbackFn = config.callback,
successFn = config.success,
failureFn = config.failure,
scope = config.scope,
record, callback;
callback = function(operation) {
--> record = operation.getRecords()[0];
if (operation.wasSuccessful()) {
if (typeof successFn == 'function') {
successFn.call(scope, record, operation);
}
} else {
if (typeof failureFn == 'function') {
failureFn.call(scope, record, operation);
}
}
if (typeof callbackFn == 'function') {
callbackFn.call(scope, record, operation);
}
};
this.proxy.read(operation, callback, this);
}
},
-
7 Mar 2011 8:48 PM #2
This should be fixed in the next release.
Evan Trimboli
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!
Thank you for reporting this bug. We will make it our priority to review this report.
Similar Threads
-
using url to load data I get an error in Extjs-all-debug.js
By webarnie in forum Ext Designer: Help & DiscussionReplies: 1Last Post: 1 Mar 2011, 2:11 PM -
How do you load json data array into Store, and still get full Model conversion?
By JacobGu in forum Sencha Touch 1.x: DiscussionReplies: 2Last Post: 15 Nov 2010, 10:47 AM -
Can not load data in store. Error: data is not object
By Jaeger in forum Sencha Touch 1.x: DiscussionReplies: 4Last Post: 6 Sep 2010, 1:04 AM -
[CLOSED] Bug in GroupingGrid with nested properties in model data
By AntoniM in forum Ext GWT: Bugs (2.x)Replies: 1Last Post: 13 Apr 2010, 11:40 AM -
[CLOSED][3.1] Error Yahoo adapter not all plugins load
By oniram88 in forum Ext 3.x: BugsReplies: 2Last Post: 4 Feb 2010, 2:35 PM


Reply With Quote