Threaded View

  1. #1
    Sencha User
    Join Date
    Jan 2013
    Posts
    8
    Vote Rating
    0
    hosokaws is on a distinguished road

      0  

    Default Problem and solution about Model with Ext.Direct proxy

    Problem and solution about Model with Ext.Direct proxy


    I found a problem that Model with direct proxy failed to initialize, especially after app was built. It showed error messages like "Uncaught TypeError: Cannot read property 'directCfg' of null" when the Model try to call proxy.
    Because the Model class try to create instance of proxy when the class is defined ( not when the class is instanciated).
    The Direct proxy evaluates directFn only when it is set at applyDirectFn. To prevent failure, I extended Ext.data.proxy.Direct class. This class evaluates directFn whenever it is obtained at getDirectFn.

    Code:
    Ext.define('SevenDays.proxy.DirectWithStringFn', {
        extend : 'Ext.data.proxy.Direct',
        alias : 'proxy.directWithStringFn',
        requires : [ 'Ext.data.proxy.Direct' ],
    
    
        applyDirectFn : function(directFn) {
            //<debug>
            if (!Ext.isString(directFn)) {
                console.log('directFn must be string.');
            }
            //</debug>
            return directFn;
        },
        getDirectFn : function() {
            var me = this;
            var directFn = me.callParent(arguments);
            //<debug>
            if (!Ext.isString(directFn)) {
                console.log('directFn must be string.');
            }
            //</debug>
            return Ext.direct.Manager.parseMethod(directFn);
        }
    });
    I consider that it is better to keep directFn once it is parsed correctly.
    Last edited by hosokaws; 12 Jul 2013 at 3:02 AM. Reason: To add specific error message

Thread Participants: 2

Tags for this Thread

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..."