Results 1 to 2 of 2

Thread: Appended Iframe listeners are not working

  1. #1
    Sencha Premium Member
    Join Date
    Jun 2014
    Location
    Stuttgart, Germany
    Posts
    1

    Question Answered: Appended Iframe listeners are not working

    I'm relatively new to ExtJS and I'm trying to append an Iframe with listeners to the DOM. But unfortunately the listeners are not working. Both console.logs are not printing anything. What am I doing wrong. I hope someone can help.

    My ExtJS Version is 4.2.2.

    Code:
    Ext.DomHelper.append(container.getEl().dom.id, {
                tag: 'iframe',
                frameBorder: 0,
                width: 0,
                height: 0,
                css: 'display:none;visibility:hidden;height:0px;',
                src: urls[y],
                listeners: {
                    afterrender: function () {
                        console.log('rendered');
                        this.getEl().on('load', function () {
                            console.log('loaded');
                        });
                    }
                }
            }
    Kevin

  2. Hi,

    You can't pass a listeners config in the domHelper config to create the iframe element.
    I would create the iFrame, set the listener on it using on() and then set the src.

  3. #2
    Sencha User slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    6,165
    Answers
    505

    Default

    Hi,

    You can't pass a listeners config in the domHelper config to create the iframe element.
    I would create the iFrame, set the listener on it using on() and then set the src.

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
  •