PDA

View Full Version : How do I change the src of my iframe with ext?



DuGi
21 Jun 2007, 9:01 AM
Hey,

I know, this might be a very simple question. But since i fairly new to ext js, I hope you guys can help me out.

I have a iframe. When I click a row of my grid, I get an id. This id would I like to put into the iframe's source and then update the iframe with the id.

I have the id, but I can seem to update the iframe's src. Can someone tell me how I do this?

Thank you, and sorry for the newbie question.

Animal
21 Jun 2007, 9:46 AM
You don't use Ext, you just set it.

DuGi
21 Jun 2007, 9:56 AM
Ah okay, thought that maybe there were a cool way.
Thanks for the quick response :)

Nullity
21 Jun 2007, 11:59 AM
Either of these should work:


// Ext
Ext.get('iframe_id').dom.src = 'somefile.html';

or

// standard javascript
document.getElementById('iframe_id').src = 'somefile.html';

DuGi
21 Jun 2007, 12:03 PM
Thank you!
I'll use the Ext method, just because I can :b