Results 1 to 6 of 6

Thread: Problem and solution about Model with Ext.Direct proxy

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Sencha User
    Join Date
    Jan 2013
    Vote Rating

    Default 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 class. This class evaluates directFn whenever it is obtained at getDirectFn.

    Ext.define('SevenDays.proxy.DirectWithStringFn', {
        extend : '',
        alias : 'proxy.directWithStringFn',
        requires : [ '' ],
        applyDirectFn : function(directFn) {
            if (!Ext.isString(directFn)) {
                console.log('directFn must be string.');
            return directFn;
        getDirectFn : function() {
            var me = this;
            var directFn = me.callParent(arguments);
            if (!Ext.isString(directFn)) {
                console.log('directFn must be string.');
    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

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts