X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/c930e9176a5a85509c5b0230e2bff5c22a591432..25ef3491bd9ae007ff1fc2b0d7943e6eaaccf775:/pkgs/data-foundation-debug.js
diff --git a/pkgs/data-foundation-debug.js b/pkgs/data-foundation-debug.js
index 5076cfc8..8164b7dc 100644
--- a/pkgs/data-foundation-debug.js
+++ b/pkgs/data-foundation-debug.js
@@ -1,9 +1,10 @@
/*!
- * Ext JS Library 3.0.0
+ * Ext JS Library 3.0.3
* Copyright(c) 2006-2009 Ext JS, LLC
* licensing@extjs.com
* http://www.extjs.com/license
*/
+
/**
* @class Ext.data.Api
* @extends Object
@@ -184,10 +185,86 @@ new Ext.data.HttpProxy({
for (var verb in this.restActions) {
proxy.api[this.actions[verb]].method = this.restActions[verb];
}
+ // TODO: perhaps move this interceptor elsewhere? like into DataProxy, perhaps? Placed here
+ // to satisfy initial 3.0 final release of REST features.
+ proxy.onWrite = proxy.onWrite.createInterceptor(function(action, o, response, rs) {
+ var reader = o.reader;
+ var res = new Ext.data.Response({
+ action: action,
+ raw: response
+ });
+
+ switch (response.status) {
+ case 200: // standard 200 response, send control back to HttpProxy#onWrite
+ return true;
+ break;
+ case 201: // entity created but no response returned
+ //res[reader.meta.successProperty] = true;
+ res.success = true;
+ break;
+ case 204: // no-content. Create a fake response.
+ //res[reader.meta.successProperty] = true;
+ //res[reader.meta.root] = null;
+ res.success = true;
+ res.data = null;
+ break;
+ default:
+ return true;
+ break;
+ }
+ /*
+ if (res[reader.meta.successProperty] === true) {
+ this.fireEvent("write", this, action, res[reader.meta.root], res, rs, o.request.arg);
+ } else {
+ this.fireEvent('exception', this, 'remote', action, o, res, rs);
+ }
+ */
+ if (res.success === true) {
+ this.fireEvent("write", this, action, res.data, res, rs, o.request.arg);
+ } else {
+ this.fireEvent('exception', this, 'remote', action, o, res, rs);
+ }
+ o.request.callback.call(o.request.scope, res.data, res, res.success);
+
+ return false; // <-- false to prevent intercepted function from running.
+ }, proxy);
}
};
})();
+/**
+ * Ext.data.Response
+ * Experimental. Do not use directly.
+ */
+Ext.data.Response = function(params, response) {
+ Ext.apply(this, params, {
+ raw: response
+ });
+};
+Ext.data.Response.prototype = {
+ message : null,
+ success : false,
+ status : null,
+ root : null,
+ raw : null,
+
+ getMessage : function() {
+ return this.message;
+ },
+ getSuccess : function() {
+ return this.success;
+ },
+ getStatus : function() {
+ return this.status
+ },
+ getRoot : function() {
+ return this.root;
+ },
+ getRawResponse : function() {
+ return this.raw;
+ }
+};
+
/**
* @class Ext.data.Api.Error
* @extends Ext.Error
@@ -208,6 +285,8 @@ Ext.apply(Ext.data.Api.Error.prototype, {
'execute': 'Attempted to execute an unknown action. Valid API actions are defined in Ext.data.Api.actions"'
}
});
+
+
/**
* @class Ext.data.SortTypes
@@ -309,8 +388,9 @@ Ext.data.SortTypes = {
* {@link #data}
and {@link #id}
properties.
Record objects generated by this constructor inherit all the methods of Ext.data.Record listed below.
* @constructor - * This constructor should not be used to create Record objects. Instead, use {@link #create} to - * generate a subclass of Ext.data.Record configured with information about its constituent fields. + *This constructor should not be used to create Record objects. Instead, use {@link #create} to + * generate a subclass of Ext.data.Record configured with information about its constituent fields.
+ *
The generated constructor has the same signature as this constructor.
* @param {Object} data (Optional) An object, the properties of which provide values for the new Record's * fields. If not specified the{@link Ext.data.Field#defaultValue defaultValue}
* for each field will be assigned.
@@ -361,7 +441,7 @@ myStore.{@link Ext.data.Store#add add}(myNewRecord);
* @method create
* @return {function} A constructor which is used to create new Records according
- * to the definition. The constructor has the same signature as {@link #Ext.data.Record}.
+ * to the definition. The constructor has the same signature as {@link #Record}.
* @static
*/
Ext.data.Record.create = function(o){
@@ -813,6 +893,9 @@ var recId = 100; // provide unique id for the record
var r = new myStore.recordType(defaultData, ++recId); // create new record
myStore.{@link #insert}(0, r); // insert a new record into the store (also see {@link #add})
*
+ * Writing Data
+ *And new in Ext version 3, use the new {@link Ext.data.DataWriter DataWriter} to create an automated, Writable Store
+ * along with RESTful features.
* @constructor
* Creates a new Store.
* @param {Object} config A config object containing the objects needed for the Store to access data,
@@ -841,7 +924,7 @@ Ext.data.Store = function(config){
}
Ext.apply(this, config);
-
+
this.paramNames = Ext.applyIf(this.paramNames || {}, this.defaultParamNames);
if(this.url && !this.proxy){
@@ -859,7 +942,8 @@ Ext.data.Store = function(config){
this.recordType = this.reader.recordType;
}
if(this.reader.onMetaChange){
- this.reader.onMetaChange = this.onMetaChange.createDelegate(this);
+ //this.reader.onMetaChange = this.onMetaChange.createDelegate(this);
+ this.reader.onMetaChange = this.reader.onMetaChange.createSequence(this.onMetaChange, this);
}
if (this.writer) { // writer passed
this.writer.meta = this.reader.meta;
@@ -991,6 +1075,7 @@ var grid = new Ext.grid.EditorGridPanel({
* @event clear
* Fires when the data cache has been cleared.
* @param {Store} this
+ * @param {Record[]} The records that were cleared.
*/
'clear',
/**
@@ -1032,7 +1117,7 @@ var grid = new Ext.grid.EditorGridPanel({
'loadexception',
/**
* @event beforewrite
- * @param {DataProxy} this
+ * @param {Ext.data.Store} store
* @param {String} action [Ext.data.Api.actions.create|update|destroy]
* @param {Record/Array[Record]} rs
* @param {Object} options The loading options that were specified. Edit options.params
to add Http parameters to the request. (see {@link #save} for details)
@@ -1042,9 +1127,8 @@ var grid = new Ext.grid.EditorGridPanel({
/**
* @event write
* Fires if the server returns 200 after an Ext.data.Api.actions CRUD action.
- * Success or failure of the action is available in the result['successProperty']
property.
- * The server-code might set the successProperty
to false if a database validation
- * failed, for example.
+ * Success of the action is determined in the result['successProperty']
property (NOTE for RESTful stores,
+ * a simple 20x response is sufficient for the actions "destroy" and "update". The "create" action should should return 200 along with a database pk).
* @param {Ext.data.Store} store
* @param {String} action [Ext.data.Api.actions.create|update|destroy]
* @param {Object} result The 'data' picked-out out of the response for convenience.
@@ -1063,7 +1147,8 @@ var grid = new Ext.grid.EditorGridPanel({
scope: this,
add: this.createRecords,
remove: this.destroyRecord,
- update: this.updateRecord
+ update: this.updateRecord,
+ clear: this.onClear
});
}
@@ -1241,7 +1326,7 @@ sortInfo: {
* internally be set to false.
An object containing properties which specify the names of the paging and @@ -1261,7 +1346,7 @@ sortInfo: { * the parameter names to use in its {@link #load requests}. */ paramNames : undefined, - + /** * @cfg {Object} defaultParamNames * Provides the default values for the {@link #paramNames} property. To globally modify the parameters @@ -1278,13 +1363,17 @@ sortInfo: { * Destroys the store. */ destroy : function(){ - if(this.storeId){ - Ext.StoreMgr.unregister(this); + if(!this.isDestroyed){ + if(this.storeId){ + Ext.StoreMgr.unregister(this); + } + this.clearData(); + this.data = null; + Ext.destroy(this.proxy); + this.reader = this.writer = null; + this.purgeListeners(); + this.isDestroyed = true; } - this.data = null; - Ext.destroy(this.proxy); - this.reader = this.writer = null; - this.purgeListeners(); }, /** @@ -1327,6 +1416,7 @@ sortInfo: { remove : function(record){ var index = this.data.indexOf(record); if(index > -1){ + record.join(null); this.data.removeAt(index); if(this.pruneModifiedRecords){ this.modified.remove(record); @@ -1350,14 +1440,25 @@ sortInfo: { * Remove all Records from the Store and fires the {@link #clear} event. */ removeAll : function(){ - this.data.clear(); + var items = []; + this.each(function(rec){ + items.push(rec); + }); + this.clearData(); if(this.snapshot){ this.snapshot.clear(); } if(this.pruneModifiedRecords){ this.modified = []; } - this.fireEvent('clear', this); + this.fireEvent('clear', this, items); + }, + + // private + onClear: function(store, records){ + Ext.each(records, function(rec, index){ + this.destroyRecord(this, rec, index); + }, this); }, /** @@ -1429,6 +1530,14 @@ sortInfo: { this.lastOptions = o; }, + // private + clearData: function(){ + this.data.each(function(rec) { + rec.join(null); + }); + this.data.clear(); + }, + /** *
Loads the Record cache from the configured {@link #proxy} using the configured {@link #reader}.
*Notes:
Ext.data.DataWriter facilitates create, update, and destroy actions between @@ -2678,14 +2867,8 @@ var store = new Ext.data.Store({ * using {@link Ext.data.Record#create}. */ Ext.data.DataWriter = function(config){ - /** - * This DataWriter's configured metadata as passed to the constructor. - * @type Mixed - * @property meta - */ Ext.apply(this, config); }; - Ext.data.DataWriter.prototype = { /** @@ -2710,7 +2893,18 @@ Ext.data.DataWriter.prototype = { * @param {Record/Record[]} rs The recordset write. */ write : function(action, params, rs) { - this.render(action, rs, params, this[action](rs)); + var data = [], + renderer = action + 'Record'; + // TODO implement @cfg listful here + if (Ext.isArray(rs)) { + Ext.each(rs, function(rec){ + data.push(this[renderer](rec)); + }, this); + } + else if (rs instanceof Ext.data.Record) { + data = this[renderer](rs); + } + this.render(action, rs, params, data); }, /** @@ -2724,84 +2918,17 @@ Ext.data.DataWriter.prototype = { render : Ext.emptyFn, /** - * update - * @param {Object} p Params-hash to apply result to. - * @param {Record/Record[]} rs Record(s) to write - * @private - */ - update : function(rs) { - var params = {}; - if (Ext.isArray(rs)) { - var data = [], - ids = []; - Ext.each(rs, function(val){ - ids.push(val.id); - data.push(this.updateRecord(val)); - }, this); - params[this.meta.idProperty] = ids; - params[this.meta.root] = data; - } - else if (rs instanceof Ext.data.Record) { - params[this.meta.idProperty] = rs.id; - params[this.meta.root] = this.updateRecord(rs); - } - return params; - }, - - /** - * @cfg {Function} saveRecord Abstract method that should be implemented in all subclasses - * (e.g.: {@link Ext.data.JsonWriter#saveRecord JsonWriter.saveRecord} + * @cfg {Function} updateRecord Abstract method that should be implemented in all subclasses + * (e.g.: {@link Ext.data.JsonWriter#updateRecord JsonWriter.updateRecord} */ updateRecord : Ext.emptyFn, - /** - * create - * @param {Object} p Params-hash to apply result to. - * @param {Record/Record[]} rs Record(s) to write - * @private - */ - create : function(rs) { - var params = {}; - if (Ext.isArray(rs)) { - var data = []; - Ext.each(rs, function(val){ - data.push(this.createRecord(val)); - }, this); - params[this.meta.root] = data; - } - else if (rs instanceof Ext.data.Record) { - params[this.meta.root] = this.createRecord(rs); - } - return params; - }, - /** * @cfg {Function} createRecord Abstract method that should be implemented in all subclasses * (e.g.: {@link Ext.data.JsonWriter#createRecord JsonWriter.createRecord}) */ createRecord : Ext.emptyFn, - /** - * destroy - * @param {Object} p Params-hash to apply result to. - * @param {Record/Record[]} rs Record(s) to write - * @private - */ - destroy : function(rs) { - var params = {}; - if (Ext.isArray(rs)) { - var data = [], - ids = []; - Ext.each(rs, function(val){ - data.push(this.destroyRecord(val)); - }, this); - params[this.meta.root] = data; - } else if (rs instanceof Ext.data.Record) { - params[this.meta.root] = this.destroyRecord(rs); - } - return params; - }, - /** * @cfg {Function} destroyRecord Abstract method that should be implemented in all subclasses * (e.g.: {@link Ext.data.JsonWriter#destroyRecord JsonWriter.destroyRecord}) @@ -2809,7 +2936,7 @@ Ext.data.DataWriter.prototype = { destroyRecord : Ext.emptyFn, /** - * Converts a Record to a hash + * Converts a Record to a hash. * @param {Record} * @private */ @@ -2823,7 +2950,16 @@ Ext.data.DataWriter.prototype = { data[m.mapping ? m.mapping : m.name] = value; } }); - data[this.meta.idProperty] = rec.id; + // we don't want to write Ext auto-generated id to hash. Careful not to remove it on Models not having auto-increment pk though. + // We can tell its not auto-increment if the user defined a DataReader field for it *and* that field's value is non-empty. + // we could also do a RegExp here for the Ext.data.Record AUTO_ID prefix. + if (rec.phantom) { + if (rec.fields.containsKey(this.meta.idProperty) && Ext.isEmpty(rec.data[this.meta.idProperty])) { + delete data[this.meta.idProperty]; + } + } else { + data[this.meta.idProperty] = rec.id + } return data; } };/** @@ -2889,7 +3025,27 @@ api: { update : undefined, destroy : undefined } - + * + *
The url is built based upon the action being executed [load|create|save|destroy] + * using the commensurate {@link #api} property, or if undefined default to the + * configured {@link Ext.data.Store}.{@link Ext.data.Store#url url}.
For example:
+ *
+api: {
+ load : '/controller/load',
+ create : '/controller/new', // Server MUST return idProperty of new record
+ save : '/controller/update',
+ destroy : '/controller/destroy_action'
+}
+
+// Alternatively, one can use the object-form to specify each API-action
+api: {
+ load: {url: 'read.php', method: 'GET'},
+ create: 'create.php',
+ destroy: 'destroy.php',
+ save: 'update.php'
+}
+ *
* If the specific URL for a given CRUD action is undefined, the CRUD action request * will be directed to the configured {@link Ext.data.Connection#url url}.
*Note: To modify the URL for an action dynamically the appropriate API @@ -2907,22 +3063,9 @@ myStore.on({ // permanent, applying this URL for all subsequent requests. store.proxy.setUrl('changed1.php', true); - // manually set the private connection URL. - // Warning: Accessing the private URL property should be avoided. - // Use the public method {@link Ext.data.HttpProxy#setUrl setUrl} instead, shown above. - // It should be noted that changing the URL like this will affect - // the URL for just this request. Subsequent requests will use the - // API or URL defined in your initial proxy configuration. - store.proxy.conn.url = 'changed1.php'; - - // proxy URL will be superseded by API (only if proxy created to use ajax): - // It should be noted that proxy API changes are permanent and will - // be used for all subsequent requests. - store.proxy.api.load = 'changed2.php'; - - // However, altering the proxy API should be done using the public - // method {@link Ext.data.DataProxy#setApi setApi} instead. - store.proxy.setApi('load', 'changed2.php'); + // Altering the proxy API should be done using the public + // method {@link Ext.data.DataProxy#setApi setApi}. + store.proxy.setApi('read', 'changed2.php'); // Or set the entire API with a config-object. // When using the config-object option, you must redefine the entire @@ -2939,23 +3082,17 @@ myStore.on({ * *
*/ - // Prepare the proxy api. Ensures all API-actions are defined with the Object-form. - try { - Ext.data.Api.prepare(this); - } catch (e) { - if (e instanceof Ext.data.Api.Error) { - e.toConsole(); - } - } this.addEvents( /** * @event exception - *Fires if an exception occurs in the Proxy during a remote request. - * This event is relayed through a corresponding - * {@link Ext.data.Store}.{@link Ext.data.Store#exception exception}, - * so any Store instance may observe this event. - * This event can be fired for one of two reasons:
+ *Fires if an exception occurs in the Proxy during a remote request. This event is relayed + * through a corresponding {@link Ext.data.Store}.{@link Ext.data.Store#exception exception}, + * so any Store instance may observe this event.
+ *In addition to being fired through the DataProxy instance that raised the event, this event is also fired + * through the Ext.data.DataProxy class to allow for centralized processing of exception events from all + * DataProxies by attaching a listener to the Ext.data.Proxy class itself.
+ *This event can be fired for one of two reasons:
*Fires before a request is generated for one of the actions Ext.data.Api.actions.create|update|destroy
+ *In addition to being fired through the DataProxy instance that raised the event, this event is also fired + * through the Ext.data.DataProxy class to allow for centralized processing of beforewrite events from all + * DataProxies by attaching a listener to the Ext.data.Proxy class itself.
* @param {DataProxy} this The proxy for the request * @param {String} action [Ext.data.Api.actions.create|update|destroy] * @param {Record/Array[Record]} rs The Record(s) to create|update|destroy. @@ -3048,7 +3188,10 @@ myStore.on({ 'beforewrite', /** * @event write - * Fires before the request-callback is called + *Fires before the request-callback is called
+ *In addition to being fired through the DataProxy instance that raised the event, this event is also fired + * through the Ext.data.DataProxy class to allow for centralized processing of write events from all + * DataProxies by attaching a listener to the Ext.data.Proxy class itself.
* @param {DataProxy} this The proxy that sent the request * @param {String} action [Ext.data.Api.actions.create|upate|destroy] * @param {Object} data The data object extracted from the server-response @@ -3059,6 +3202,17 @@ myStore.on({ 'write' ); Ext.data.DataProxy.superclass.constructor.call(this); + + // Prepare the proxy api. Ensures all API-actions are defined with the Object-form. + try { + Ext.data.Api.prepare(this); + } catch (e) { + if (e instanceof Ext.data.Api.Error) { + e.toConsole(); + } + } + // relay each proxy's events onto Ext.data.DataProxy class for centralized Proxy-listening + Ext.data.DataProxy.relayEvents(this, ['beforewrite', 'write', 'exception']); }; Ext.extend(Ext.data.DataProxy, Ext.util.Observable, { @@ -3077,7 +3231,7 @@ store: new Ext.data.Store({ ... )} * - * There is no{@link #api}
specified in the configuration of the proxy,
+ * If there is no {@link #api}
specified in the configuration of the proxy,
* all requests will be marshalled to a single RESTful url (/users) so the serverside
* framework can inspect the HTTP Method and act accordingly:
* @@ -3087,6 +3241,18 @@ GET /users read PUT /users/23 update DESTROY /users/23 delete *+ *
If set to true, a {@link Ext.data.Record#phantom non-phantom} record's + * {@link Ext.data.Record#id id} will be appended to the url. Some MVC (e.g., Ruby on Rails, + * Merb and Django) support segment based urls where the segments in the URL follow the + * Model-View-Controller approach:
+ * someSite.com/controller/action/id
+ *
+ * Where the segments in the url are typically:Refer to {@link Ext.data.DataProxy#api}
for additional information.
If set to true, a {@link Ext.data.Record#phantom non-phantom} record's - * {@link Ext.data.Record#id id} will be appended to the url (defaults to false).
The url is built based upon the action being executed [load|create|save|destroy] - * using the commensurate {@link #api} property, or if undefined default to the - * configured {@link Ext.data.Store}.{@link Ext.data.Store#url url}.
Some MVC (e.g., Ruby on Rails, Merb and Django) support this style of segment based urls - * where the segments in the URL follow the Model-View-Controller approach.
- * someSite.com/controller/action/id
- *
- * Where the segments in the url are typically:For example:
- *
-api: {
- load : '/controller/load',
- create : '/controller/new', // Server MUST return idProperty of new record
- save : '/controller/update',
- destroy : '/controller/destroy_action'
-}
-
-// Alternatively, one can use the object-form to specify each API-action
-api: {
- load: {url: 'read.php', method: 'GET'},
- create: 'create.php',
- destroy: 'destroy.php',
- save: 'update.php'
-}
- */
-
/**
* Return the {@link Ext.data.Connection} object being used by this Proxy.
* @return {Connection} The Connection object. This object may be used to subscribe to events on
@@ -3625,6 +3769,7 @@ api: {
this.conn.url = url;
if (makePermanent === true) {
this.url = url;
+ this.api = null;
Ext.data.Api.prepare(this);
}
},
@@ -3658,10 +3803,14 @@ api: {
callback : this.createCallback(action, rs),
scope: this
};
- // Sample the request data: If it's an object, then it hasn't been json-encoded yet.
- // Transmit data using jsonData config of Ext.Ajax.request
- if (typeof(params[reader.meta.root]) === 'object') {
- o.jsonData = params;
+
+ // If possible, transmit data using jsonData || xmlData on Ext.Ajax.request (An installed DataWriter would have written it there.).
+ // Use std HTTP params otherwise.
+ // TODO wrap into 1 Ext.apply now?
+ if (params.jsonData) {
+ o.jsonData = params.jsonData;
+ } else if (params.xmlData) {
+ o.xmlData = params.xmlData;
} else {
o.params = params || {};
}
@@ -3671,7 +3820,7 @@ api: {
if (this.conn.url === null) {
this.conn.url = this.buildUrl(action, rs);
}
- else if (this.restful === true && rs instanceof Ext.data.Record && !rs.phantom) {
+ else if (this.restful === true && rs instanceof Ext.data.Record && !rs.phantom) { // <-- user must have intervened with #setApi or #setUrl
this.conn.url += '/' + rs.id;
}
if(this.useAjax){
@@ -3680,7 +3829,10 @@ api: {
// If a currently running request is found for this action, abort it.
if (this.activeRequest[action]) {
+ ////
// Disabled aborting activeRequest while implementing REST. activeRequest[action] will have to become an array
+ // TODO ideas anyone?
+ //
//Ext.Ajax.abort(this.activeRequest[action]);
}
this.activeRequest[action] = Ext.Ajax.request(o);
@@ -3704,6 +3856,7 @@ api: {
if (!success) {
if (action === Ext.data.Api.actions.read) {
// @deprecated: fire loadexception for backwards compat.
+ // TODO remove in 3.1
this.fireEvent('loadexception', this, o, response);
}
this.fireEvent('exception', this, 'response', action, o, response);
@@ -3723,6 +3876,9 @@ api: {
* @param {String} action Action name as per {@link Ext.data.Api.actions#read}.
* @param {Object} o The request transaction object
* @param {Object} res The server response
+ * @fires loadexception (deprecated)
+ * @fires exception
+ * @fires load
* @private
*/
onRead : function(action, o, response) {
@@ -3731,13 +3887,16 @@ api: {
result = o.reader.read(response);
}catch(e){
// @deprecated: fire old loadexception for backwards-compat.
+ // TODO remove in 3.1
this.fireEvent('loadexception', this, o, response, e);
+
this.fireEvent('exception', this, 'response', action, o, response, e);
o.request.callback.call(o.request.scope, null, o.request.arg, false);
return;
}
if (result.success === false) {
// @deprecated: fire old loadexception for backwards-compat.
+ // TODO remove in 3.1
this.fireEvent('loadexception', this, o, response);
// Get DataReader read-back a response-object to pass along to exception event
@@ -3747,6 +3906,9 @@ api: {
else {
this.fireEvent('load', this, o, o.request.arg);
}
+ // TODO refactor onRead, onWrite to be more generalized now that we're dealing with Ext.data.Response instance
+ // the calls to request.callback(...) in each will have to be made identical.
+ // NOTE reader.readResponse does not currently return Ext.data.Response
o.request.callback.call(o.request.scope, result, o.request.arg, result.success);
},
/**
@@ -3754,6 +3916,8 @@ api: {
* @param {String} action [Ext.data.Api.actions.create|read|update|destroy]
* @param {Object} trans The request transaction object
* @param {Object} res The server response
+ * @fires exception
+ * @fires write
* @private
*/
onWrite : function(action, o, response, rs) {
@@ -3766,12 +3930,15 @@ api: {
o.request.callback.call(o.request.scope, null, o.request.arg, false);
return;
}
- if (res[reader.meta.successProperty] === false) {
+ if (res.success === false) {
this.fireEvent('exception', this, 'remote', action, o, res, rs);
} else {
- this.fireEvent('write', this, action, res[reader.meta.root], res, rs, o.request.arg);
+ this.fireEvent('write', this, action, res.data, res, rs, o.request.arg);
}
- o.request.callback.call(o.request.scope, res[reader.meta.root], res, res[reader.meta.successProperty]);
+ // TODO refactor onRead, onWrite to be more generalized now that we're dealing with Ext.data.Response instance
+ // the calls to request.callback(...) in each will have to be made similar.
+ // NOTE reader.readResponse does not currently return Ext.data.Response
+ o.request.callback.call(o.request.scope, res.data, res, res.success);
},
// inherit docs