PDA

View Full Version : IFrame dom ready event



santosh.kumar
3 Apr 2013, 9:38 AM
Hi,

I have following code with IFrame and i would like to listen to dom ready event of IFrame. How to do that?




me.myIFrame = Ext.create('Ext.container.Container', {
region: 'center',
border: false,
width: 1000,
height: 750,
autoEl: {
tag: 'iframe',
style: 'frameborder:0;border:0',
src: 'someurl'
},
listeners: {
afterrender: function () {


this.getEl().on('load', function () {

me.showFormView();

});
}
}
}
);



Basically my goal is, by default we show grid in iframe. Once the grid is loaded i want to switch the view to form view from grid view. unless the complete dom is created i will not be able to do that. Grid and Forms are ExtJS panels.

Thanks
Santosh

slemmon
4 Apr 2013, 9:59 PM
The page loading the Ext JS library will be able to watch the cross-browser domReady event, but the iFrame is a separate document unto itself.

I believe the Ext.ux.ManagedIframe user extension could be beneficial for you.
You might check out this thread:
http://www.sencha.com/forum/showthread.php?137233-Ext.ux.ManagedIframe-4.0-alpha2-for-Ext-4.x