PDA

View Full Version : Access the src of an iframe created as an autoEl



pajamabob
2 Nov 2009, 10:50 AM
How can I access the src property of an Iframe created using the autoEl definition of a box element.

I have tried:

Ext.getCmp('preWin_1')getEl().dom.src

No luck so far...





{
xtype:'box',
id: 'preWin_1'
anchor: '100% 100%',
autoEl: {
tag: 'iframe',
height: '99%',
width: '100%',
border: '0',
frameborder: '0',
scrolling: 'no',
src: '../Templates/Ya.htm'
}
}

hendricd
2 Nov 2009, 11:12 AM
@pajamabob -- Might be doing it too soon:


var frame = Ext.getCmp('preWin_1');
if(frame && frame.rendered ){
frame.getEl().dom.src = url;
}

pajamabob
2 Nov 2009, 11:14 AM
That would make a lot of sense. Let me try something...

pajamabob
2 Nov 2009, 2:24 PM
Works pefectly. I added code to the activate event of the tab container and all is well.

Thanks!\:D/

sreeraj1237
9 Dec 2013, 9:02 PM
Thanks for your post.
This code is working fine. But after redirection from the page loaded in iframe and then taken the src value, I got the initially loaded src value. Is there any way to get the redirected page's url?