1. #1
    Touch Premium Member
    Join Date
    Sep 2011
    Location
    Owings Mills
    Posts
    1
    Vote Rating
    0
    mvijay is on a distinguished road

      0  

    Default Minifying Direct Function (in php)

    Minifying Direct Function (in php)


    After compressing the application using sencha build, the web page is not loading using the new compressed js file.

    In the developer tools the following error is throw "Uncaught TypeError: Cannot call method 'getTreeByJurisdiction' of undefined "

    The function getTreeByJurisdiction is from a PHP file for directFn directive.

    Is there anything special that needs to be done for compressing a ext JS app that uses Ext direct?

  2. #2
    Sencha - Ext JS Dev Team
    Join Date
    Jun 2011
    Location
    San Diego, CA
    Posts
    131
    Vote Rating
    10
    nohuhu will become famous soon enough

      0  

    Default


    This is a common pitfall; move directFn assignment from class definition to constructor. I.e.:
    PHP Code:
    Ext.define('My.Store', {
        
    extend'Ext.data.Store',

        
    proxy: {
            
    type'direct',
            
    directFnDirect.Store.method
        
    }
    }); 
    becomes

    PHP Code:
    Ext.define('My.Store', {
        
    extend'Ext.data.Store',

        
    constructor: function(config) {
            var 
    me this;

            
    Ext.apply(meconfig);

            
    me.proxy = {
                
    type'direct',
                
    directFnDirect.Store.method
            
    };

            
    me.callParent(arguments);
        }
    }); 
    By the time your Store is instantiated all symbols should be resolved.

    Regards,
    Alex.

Tags for this Thread