Results 1 to 2 of 2

Thread: Did listeners on panel depends on the panel content?

  1. #1
    Sencha User
    Join Date
    Feb 2014
    Posts
    1

    Default Did listeners on panel depends on the panel content?

    I wan't to detect 'pinch' event on a Extjs 5 Panel, if I load the panel content using loader property it's working, but if I put an item (Iframe) in the panel, it doesn't work
    Panel with an item (IFrame):

    Code:
    Ext.create('Ext.panel.Panel', {
        layout: 'fit',
        autoScroll: true,
        items: [
            Ext.create('Ext.ux.IFrame', {
                autoScroll: true,
                src: 'resources/docs/doc1.html',
                cls: 'iframeStyle'
    })
        ],
        listeners: {
            pinch: function (event) {
                alert('cc');
            },
            element: 'body'
    }
    }
    Panel that the content was loaded using loader property:

    Code:
    Ext.create('Ext.panel.Panel', {
        layout: 'fit',
        loader: {
            url: 'resources/docs/doc1.html',
            autoLoad: true
        },
        listeners: {
            pinch: function (event) {
                alert('cc');
            },
            element: 'body'
        }
    })
    Can you explain me the difference, and why with an IFrame it doesn't work??

    Thank you



  2. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,448
    Answers
    3997

    Default

    The issue is the events are within the iframe's document, not the document your app is living in. An iframe is it's own page, sandboxed from the other documents or the parent document.
    Mitchell Simoens @LikelyMitch

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

    Posts are my own, not any current, past or future employer's.

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
  •