1. #1
    Sencha User
    Join Date
    Dec 2009
    Posts
    59
    Vote Rating
    0
    Werzi2001 is on a distinguished road

      0  

    Default [ExtJS 4.1.1a] Error using cmp.removeAll

    [ExtJS 4.1.1a] Error using cmp.removeAll


    Hi,

    i have a big ExtJS application where i am using removeAll to replace the content of a container (first removeAll, then add new content). The problem is that in IE i get the error
    "Das Objekt unterstützt die Eigenschaft oder Methode "removeEventListener" nicht"
    (In english something like "The object doesn't have the property or method 'removeEventListener'")

    The error occurs in Ext.EventManager.removeListner (after the check if detachEvent exists). I think that the error occurs because the EventManager tries to remove an event from a dom object which doesn't exist anymore.

    I am sorry but i didn't manage to provide a test case because the error doesn't seem to occur in simple cases.

    Doesn anybody have an idea what i am doing wrong? May sencha should add a test if the dom is still valid before calling "removeEventListener"?

    Thanks a lot!
    Yours
    Thomas

    PS:
    The error only occurs if i call "cmp.removeAll(true)" but doesn't if i call "cmp.removeAll(false)". But if i don't destory the elements the browsers memory gets filled, doesn't it?

  2. #2
    Sencha User
    Join Date
    Dec 2009
    Posts
    59
    Vote Rating
    0
    Werzi2001 is on a distinguished road

      0  

    Default


    I did some further research and the error occurs on removing the "click" handler from a triggerWrap element of a file upload field. The element seems not to be a valid element (anymore).

    PS:
    I have tried to edit the initial post but every time i saved the change i was logged out and received a message that told me i don't have permissions and should login again.

  3. #3
    Sencha User
    Join Date
    Dec 2009
    Posts
    59
    Vote Rating
    0
    Werzi2001 is on a distinguished road

      0  

    Default


    Sorry for reposting again but i still may not edit my posts.

    I finally did manage to create a test case that triggers the error. Code first:

    index.html
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        
            <link rel="stylesheet" type="text/css" href="./extjs/resources/css/ext-all-gray.css"/>
            <script type="text/javascript" src="./extjs/ext-all.js"></script>
        </head>
        <body>
            <script type="text/javascript">
                Ext.onReady(function() {
                    var panel = Ext.create('Ext.panel.Panel', {
                        id: 'panel',
                        renderTo: document.body,
                        title: 'Test',
                        width: 400,
                        height: 300,
                        items: [{
                            xtype: 'filefield',
                        }]
                    });
                    
                    var button = Ext.create('Ext.button.Button', {
                        renderTo: document.body,
                        text: 'Click',
                        listeners: {
                            click: function(b, e, eopts) {
                                Ext.create('Ext.ComponentLoader', {
                                    target: panel,
                                    url: 'test.html',
                                    autoLoad: true,
                                    scripts: true
                                });
                            }
                        }
                    });
                });
            </script>
        </body>
    </html>
    test.html:
    Code:
    <script type="text/javascript">
        (function() {
            var panel = Ext.getCmp('panel');
            panel.removeAll(true);
            panel.add({
                html: 'test'
            });
        }).call();
    </script>
    So the error is only triggered if the "removeAll" is called from within the ComponentLoader.

    Am i doing anything wrong or is this a bug in ExtJS?

    Yours
    Thomas

    PS:
    The error seems only to be triggered if the target of the ComponentLoader is the same as the target get gets cleared.

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar