Results 1 to 7 of 7

Thread: function() does not exist error with 4.1b3

  1. #1
    Ext JS Premium Member
    Join Date
    Jan 2008
    Posts
    379
    Vote Rating
    2
      0  

    Default function() does not exist error with 4.1b3

    I have a large application that works OK under 4.1b2 with minor issues.

    However under 4.1b3 I start to see errors indicating that functions defined in my
    own classes dont exist.

    I have several classes which are created with Ext.define('') but are not derived from
    any other class. These are generally functional classes which are used in the application.

    I have a config: defined and a constructor which calls initConfig().

    This all works fine in Ext 4.0 and up to 4.1b2 but suddenly fails in 4.1b3. Looking with
    firebug, I notice that some of the functions defined in the class look like they havent
    been properly defined in the class. They appear as 'function()' but there is no info.

    Other functions have a + which I can click on which give information on the function
    name, etc.

    I also see a lot of new booleans _isBlahInitialized for variables 'Blah' that I've put in
    config.

    Any ideas what I should look for?

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,326
    Vote Rating
    1297
      0  

    Default

    Using this class:

    Code:
    Ext.define('MyClass', {
        config : {
            foo      : 'bar',
            name     : 'mitch',
            country  : 'usa',
            employer : 'Sencha',
            obj      : {
                hello : 'hi'
            }
        },
    
        constructor : function(config) {
            config = config || {};
    
            this.initConfig(config);
    
            this.callParent([config]);
        }
    });
    When I create the class I see all the getter/setter methods from each of the config object keys. I'm not too sure what you are meaning.

    The _is*Initialized keys are just to tell the class that the config key has been dealt with.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Ext JS Premium Member
    Join Date
    Jan 2008
    Posts
    379
    Vote Rating
    2
      0  

    Default

    My class is very similar to the above - but there are around 300 functions defined

    myfunc: function(){
    return somevalue;
    },

    etc

    about 280 functions are fine but for some reason about 20 dont work. so if I do

    this.myfunc()

    I get the message function does not exist. There doesnt seem to be any logic to the
    functions that work and dont, in many cases very similar functions one works one
    doesnt.

    One of the problem functions is called getWidth()

  4. #4
    Ext JS Premium Member
    Join Date
    Jan 2008
    Posts
    379
    Vote Rating
    2
      0  

    Default

    Strangely - the class actually looses functions over time.

    It works near perfectly in 4.1b2 so not sure what changed from b2 to b3 that would affect this.

  5. #5
    Sencha - Community Support Team mankz's Avatar
    Join Date
    Nov 2007
    Location
    Stockholm, Sweden
    Posts
    3,015
    Vote Rating
    182
      0  

    Default

    This sounds scary, can you post a test case?

  6. #6
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,790
    Vote Rating
    390
      0  

    Default

    Does this happen consistently across all browsers or is it specific to certain browsers?

    Do the functions that disappear have names that coincide with framework function names? No idea why this would matter but you mention getWidth and it got me thinking.

  7. #7
    Ext JS Premium Member
    Join Date
    Jan 2008
    Posts
    379
    Vote Rating
    2
      0  

    Default

    The problem occurred in Firefox and Chrome but not IE for some reason. I reworked the function to a generic javascript class and it works fine now.

Posting Permissions

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