Results 1 to 2 of 2

Thread: [2.1] Overriding singleton not working

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Ext JS Premium Member Steffen Hiller's Avatar
    Join Date
    Mar 2008
    Posts
    786
    Vote Rating
    36
      0  

    Default [2.1] Overriding singleton not working

    I'm getting the same error as in this bug report from March which was reported as fixed:
    http://www.sencha.com/forum/showthread.php?185360

    Error:
    Uncaught TypeError: Object [object Object] has no method 'override'
    File: sencha-touch.js:6597
    Line: this.get(overriddenClassName).override(data);

    Test case:
    Code:
    Ext.define('App.override.util.Format', {
        override: 'Ext.util.Format'
    });
    My work around for now:
    Code:
    Ext.define('App.override.util.Format', {
    }, function () {
        var date_without_override = Ext.util.Format.date;
        
        Ext.util.Format.date = function (value, format) {
            ... // my override code
            
            return date_without_override(value, format);
        };
    });

  2. #2
    Sencha User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,050
    Vote Rating
    1381
      0  

    Default

    That post wasn't marked as fixed, it was closed due to this statement from Jamie:

    Quote Originally Posted by Jamie Avins View Post
    Thank you for the report. You should be able to just directly change that singleton instance as a workaround until we resolve that.
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Frontend Engineer
    ________________
    Need any sort of Ext JS help? Modus Create is here to help!

    Check out my GitHub:
    https://github.com/mitchellsimoens

Posting Permissions

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