1. #1
    Sencha User
    Join Date
    Aug 2008
    Posts
    28
    Vote Rating
    0
    njw is on a distinguished road

      0  

    Default Ext.get('id') doesnt work with ManagedIFrame?

    Ext.get('id') doesnt work with ManagedIFrame?


    Hi Chaps,

    Not sure this is in the right forum... ?
    (Can an admin move it to the Help section if this is wrong? Thanks.)

    I'm using an ManagedIFrame object, and I need to be able to call JS within the document displayed within the IFrame from the parent page.

    The MIF is added inline to a panel like so:

    Code:
    {
      xtype: 'iframepanel',
      id: 'mif1',
      defaultSrc: 'page.aspx',
      height: '100%',
      fitToParent: true,
      plain: true,
      frame: false,
      border: true
    }
    My solution was to use MIF.getDocument() so that I can call the JS within the IFrame's page. To get the MIF I use:

    Code:
    var mif = Ext.get('mif1');
    doc = mif.getDocument();
    On this I get a 'getDocument' is not defined error. Checking in Firebug, Ext.get has returned an object, but it appears to be a panel, and not a MIF - hence getDocument isnt available.

    Is this method flawed/will it not work with a MIF? Is there any other solution?

    many thanks

  2. #2
    Sencha User
    Join Date
    Aug 2008
    Posts
    28
    Vote Rating
    0
    njw is on a distinguished road

      0  

    Default


    Fixed this one myself. After reading some of the docs for a different matter, I stumbled across 'Ext.ComponentMgr.get('id')' which returns an Ext component not a DOM element!

    I've not tested this (I don't require the functionality any more), but it should be the solution for anyone else having a similar issue.


    I'm still not sure this post is in the correct forum so if an admin agrees, please delete/move it to the most appropriate place!


    thanks