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
    191
    Vote Rating
    37
    nohuhu has a spectacular aura about nohuhu has a spectacular aura about

      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.

  3. #3
    Sencha User
    Join Date
    Jan 2012
    Posts
    85
    Vote Rating
    1
    ssamuel68 is on a distinguished road

      0  

    Default


    I'm having the same issue, got direct functions on my controller and got the same error

Thread Participants: 2

Tags for this Thread