Results 1 to 2 of 2

Thread: [Classic 6.5.1] ListenerRemover destroy method bug

    You found a bug! We've classified it as EXTJS-26090 . We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #1
    Sencha Premium Member
    Join Date
    Mar 2015
    Posts
    7

    Default [Classic 6.5.1] ListenerRemover destroy method bug

    Using addListener method with `element` and `destroyable` conifg in classic toolkit environment, and then an exception is raised when use destroy method.

    Sample Source

    https://fiddle.sencha.com/#view/editor&fiddle/244v

    In 6.5.0, if you click on the "click" link, the component will be successfully deleted.
    In 6.5.1, clicking on the link causes the following error and the component can not be deleted.

    Code:
    ext-all-rtl-debug.js?_dc=1501206492773:10308 Uncaught TypeError: Cannot read property 'join' of undefined
        at ListenerRemover.destroy (ext-all-rtl-debug.js?_dc=1501206492773:10308)
        at constructor.destroy (Box.js?_dc=1501206492773:30)
        at constructor.doRemove (ext-all-rtl-debug.js?_dc=1501206492773:61817)
        at constructor.remove (ext-all-rtl-debug.js?_dc=1501206492773:61667)
        at constructor.callParent (ext-all-rtl-debug.js?_dc=1501206492773:7036)
        at constructor.remove (ext-all-rtl-debug.js?_dc=1501206492773:69714)
        at constructor.click_link (Main.js?_dc=1501206492773:18)
        at constructor.fire (ext-all-rtl-debug.js?_dc=1501206492773:10124)
        at constructor.doFireEvent (ext-all-rtl-debug.js?_dc=1501206492773:10538)
        at constructor.doFireEvent (ext-all-rtl-debug.js?_dc=1501206492773:30846)
    ListenerRemover.destroy @ ext-all-rtl-debug.js?_dc=1501206492773:10308
    destroy @ Box.js?_dc=1501206492773:30
    doRemove @ ext-all-rtl-debug.js?_dc=1501206492773:61817
    remove @ ext-all-rtl-debug.js?_dc=1501206492773:61667
    callParent @ ext-all-rtl-debug.js?_dc=1501206492773:7036
    remove @ ext-all-rtl-debug.js?_dc=1501206492773:69714
    click_link @ Main.js?_dc=1501206492773:18
    fire @ ext-all-rtl-debug.js?_dc=1501206492773:10124
    doFireEvent @ ext-all-rtl-debug.js?_dc=1501206492773:10538
    doFireEvent @ ext-all-rtl-debug.js?_dc=1501206492773:30846
    prototype.doFireEvent @ ext-all-rtl-debug.js?_dc=1501206492773:27653
    fireEventArgs @ ext-all-rtl-debug.js?_dc=1501206492773:10479
    fireEvent @ ext-all-rtl-debug.js?_dc=1501206492773:10463
    me._listenerRemover.me.on.element @ Box.js?_dc=1501206492773:20
    fire @ ext-all-rtl-debug.js?_dc=1501206492773:10124
    fire @ ext-all-rtl-debug.js?_dc=1501206492773:16003
    publish @ ext-all-rtl-debug.js?_dc=1501206492773:15968
    publishDelegatedDomEvent @ ext-all-rtl-debug.js?_dc=1501206492773:15984
    doDelegatedEvent @ ext-all-rtl-debug.js?_dc=1501206492773:16022
    onDelegatedEvent @ ext-all-rtl-debug.js?_dc=1501206492773:16011
    About cause

    At line 80 to line 88 in the Ext.mixin.Observable (ext/packages/core/src/mixin/Observable.js) source code.
    There are observable.referenceList is checked.

    Ext.Widget (ext/packages/core/src/Widget.js) has a referenceList, but Ext.Component does not have it.
    Code:
        ListenerRemover.prototype.destroy = function() {
            var me = this,
                args = me.args,
                observable = me.observable,
    
                // Extract the element reference from the options object.
                // Single arg form first, options is args[3] in multi arg form.
                elementName = args[0].element || (args[3] && args[3].element);
    
            // If it was an element listener, then the listener is added to that element reference.
            if (elementName) {
                //<debug>
                if (Ext.Array.indexOf(observable.referenceList, elementName) === -1) {
                    Ext.Logger.error("Destroying event listener with an invalid element reference of '" + elementName +
                        "' for this component. Available values are: '" + observable.referenceList.join("', '") + "'", observable);
                }
                //</debug>
                observable = observable[elementName];
            }
    
            // If that observable is already destroyed, all its listeners were cleared
            if (!observable.destroyed) {
                observable[me.managedListeners ? 'mun' : 'un'].apply(observable, me.args);
            }
            me.destroy = Ext.emptyFn;
        };

  2. #2
    Sencha - Support Team
    Join Date
    Oct 2011
    Posts
    4,108

    Default

    Thanks for the report! I have opened a bug in our bug tracker.

Similar Threads

  1. [OPEN] Ext.util.TaskManager's start method don't create any destroy method
    By ElCondor1969 in forum Ext JS 6.x Bugs
    Replies: 1
    Last Post: 12 Feb 2016, 10:38 AM
  2. [CLOSED] [4.2.1] ToolbarDroppable have to have a destroy method
    By Daniil in forum Ext:Bugs
    Replies: 1
    Last Post: 29 May 2013, 9:21 AM
  3. Replies: 5
    Last Post: 20 Aug 2012, 12:32 AM

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
  •