sdiprizio
13 Oct 2011, 1:24 AM
Hi,
I tried to use a localstorage proxy in my project but when I try to sync I have an error :
TypeError: 'undefined' is not an object (evaluating 'me.proxy[operation.action]')
I've seen in the Tweeter example that localstorage seems to be non functional but I explored this error.
This error is sent in Batch.js line 178 :
me.proxy[operation.action](operation, onProxyReturn, me);
proxy is indeed undefined.
I explored a bit the Ext.data.Batch class and it seems that the constructor doesn't retain the proxy config object. It calls me.mixins.observable.constructor.call(me, config) to retain the listener but nothing about proxy.
I modified a bit the constructor to retain the proxy and it now seems to work (not completely tested).
constructor: function(config) {
var me = this;
/**
* @event complete
* Fired when all operations of this batch have been completed
* @param {Ext.data.Batch} batch The batch object
* @param {Object} operation The last operation that was executed
*/
/**
* @event exception
* Fired when a operation encountered an exception
* @param {Ext.data.Batch} batch The batch object
* @param {Object} operation The operation that encountered the exception
*/
/**
* @event operationcomplete
* Fired when each operation of the batch completes
* @param {Ext.data.Batch} batch The batch object
* @param {Object} operation The operation that just completed
*/
me.mixins.observable.constructor.call(me, config);
// HACK start sdiprizio (brute force, probably a better/cleaner way to do that)
if (config.proxy)
this.proxy = config.proxy;
// HACK end
/**
* Ordered array of operations that will be executed by this batch
* @property {Ext.data.Operation[]} operations
*/
me.operations = [];
},
Please take in consideration that I am new to Sencha, and it is possible that I do not use the API correctly and that there is actually no bug.
I'm also sorry about my poor english.
Regards.
Stephane.
I tried to use a localstorage proxy in my project but when I try to sync I have an error :
TypeError: 'undefined' is not an object (evaluating 'me.proxy[operation.action]')
I've seen in the Tweeter example that localstorage seems to be non functional but I explored this error.
This error is sent in Batch.js line 178 :
me.proxy[operation.action](operation, onProxyReturn, me);
proxy is indeed undefined.
I explored a bit the Ext.data.Batch class and it seems that the constructor doesn't retain the proxy config object. It calls me.mixins.observable.constructor.call(me, config) to retain the listener but nothing about proxy.
I modified a bit the constructor to retain the proxy and it now seems to work (not completely tested).
constructor: function(config) {
var me = this;
/**
* @event complete
* Fired when all operations of this batch have been completed
* @param {Ext.data.Batch} batch The batch object
* @param {Object} operation The last operation that was executed
*/
/**
* @event exception
* Fired when a operation encountered an exception
* @param {Ext.data.Batch} batch The batch object
* @param {Object} operation The operation that encountered the exception
*/
/**
* @event operationcomplete
* Fired when each operation of the batch completes
* @param {Ext.data.Batch} batch The batch object
* @param {Object} operation The operation that just completed
*/
me.mixins.observable.constructor.call(me, config);
// HACK start sdiprizio (brute force, probably a better/cleaner way to do that)
if (config.proxy)
this.proxy = config.proxy;
// HACK end
/**
* Ordered array of operations that will be executed by this batch
* @property {Ext.data.Operation[]} operations
*/
me.operations = [];
},
Please take in consideration that I am new to Sencha, and it is possible that I do not use the API correctly and that there is actually no bug.
I'm also sorry about my poor english.
Regards.
Stephane.