Success! Looks like we've fixed this one. According to our records the fix was applied for TOUCH-862 in a recent build.
  1. #1
    Sencha User
    Join Date
    Oct 2011
    Posts
    2
    Vote Rating
    0
    sdiprizio is on a distinguished road

      0  

    Default localstorage proxy sync error, Batch.js related ?

    localstorage proxy sync error, Batch.js related ?


    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 :

    Code:
    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).

    Code:
        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.

  2. #2
    Sencha - Sencha Touch Dev Team Jamie Avins's Avatar
    Join Date
    Mar 2007
    Location
    Redwood City, California
    Posts
    3,661
    Vote Rating
    19
    Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough

      0  

    Default


    There do seem to be some issues with LocalStorage at the moment. Thank you for the report.

  3. #3
    Ext Premium Member
    Join Date
    Sep 2009
    Posts
    48
    Vote Rating
    1
    yoh.suzuki is on a distinguished road

      0  

    Default


    Thank you for sharing, Stephane! I ran into the same problem and I'm using your workaround for now. - y

  4. #4
    Sencha - Community Support Team edspencer's Avatar
    Join Date
    Jan 2009
    Location
    Palo Alto, California
    Posts
    1,939
    Vote Rating
    7
    edspencer is a jewel in the rough edspencer is a jewel in the rough edspencer is a jewel in the rough

      0  

    Default


    This is because of some changes to Observable that require updates to Batch and a few other classes. We're working through a number of data package updates at the moment, though these will probably not make it into the next public build.
    Ext JS Senior Software Architect
    Personal Blog: http://edspencer.net
    Twitter: http://twitter.com/edspencer
    Github: http://github.com/edspencer

  5. #5
    Sencha Premium Member
    Join Date
    Jun 2011
    Location
    Nottingham, UK
    Posts
    24
    Vote Rating
    0
    mysterydiner is on a distinguished road

      0  

    Default Thankyou Stephanie

    Thankyou Stephanie


    Quote Originally Posted by sdiprizio View Post
    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 :

    Code:
    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).

    Code:
        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've been struggling with this for days and thought it was something I was doing wrong with the new MVC architecture. Well done Stephanie - works for me - thanks x a million. And your English is great too!

  6. #6
    Sencha User
    Join Date
    Mar 2007
    Location
    Haarlem, Netherlands
    Posts
    1,243
    Vote Rating
    8
    TommyMaintz will become famous soon enough

      0  

    Default


    This has been fixed as part of the next Touch 2.0 release. Thanks for the report!

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar