1. #1
    Sencha User
    Join Date
    Sep 2007
    Location
    Poland, Cracow
    Posts
    70
    Vote Rating
    0
    Evolic is on a distinguished road

      0  

    Exclamation [2.x][CLOSED] Ext.data.MemoryProxy.load() and success=false

    [2.x][CLOSED] Ext.data.MemoryProxy.load() and success=false


    Hi all,
    Today I noticed strange behaviour of the load() method inside Ext.data.MemoryProxy class.
    Function body is as follow:
    Code:
        load : function(params, reader, callback, scope, arg){
            params = params || {};
            var result;
            try {
                result = reader.readRecords(this.data);
            }catch(e){
                this.fireEvent("loadexception", this, arg, null, e);
                callback.call(scope, null, arg, false);
                return;
            }
            callback.call(scope, result, arg, true);
        }
    There is no success checking if there is no exceptions. Why?
    In my code I'm using this MemoryProxy to parse responseXML:
    1. make custom Ajax request
    2. get the response
    3. read the data using MemoryProxy

    In my case I can got success = true or false.

    So in my opinion mentioned method should looks like:
    Code:
        load : function(params, reader, callback, scope, arg){
            params = params || {};
            var result;
            try {
                result = reader.readRecords(this.data);
            }catch(e){
                this.fireEvent("loadexception", this, arg, null, e);
                callback.call(scope, null, arg, false);
                return;
            }
            if (result.success === true) {
                callback.call(scope, result, arg, true);
            } else {
                callback.call(scope, result, arg, false);
            }
        }

  2. #2
    Sencha User
    Join Date
    Sep 2007
    Location
    Poland, Cracow
    Posts
    70
    Vote Rating
    0
    Evolic is on a distinguished road

      0  

    Lightbulb my fault

    my fault


    After deeper code investigation I found out that I was wrong,
    and my fix do nothing here.
    Better Ajax usage:
    Code:
    // Basic request
    Ext.Ajax.request({
        url: '?', // URL here
        success: function(response, o) {
            // response handler
    
            var requestStore = new Ext.data.Store({
                proxy: new Ext.data.MemoryProxy(response.responseXML),
                reader: new Ext.data.XmlReader({
                        record: 'response/data',
                        success: 'response/@success'
                    }, this.publishingRecord
                )
            });
    
            requestStore.on({
                callback: function(records, success) {
                    if (success) {
                        if (records.length) {
    
                        }
                    }
                },
                scope: this
            });
    
            requestStore.load();
        },
        failure: function(response, o) {
            // exception handler
        },
        headers: {
            'Powered-By': 'Ext'
        },
        params: {
            // params here
        },
        scope: this
    });

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi