Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

  1. #1
    Sencha User
    Join Date
    Sep 2007
    Location
    Poland, Cracow
    Posts
    67
    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
    67
    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
    });