Could someone help me in updating a div in a htmleditor? Its in an iframe, so I could not do:
Ext.fly('mydiv').update('New value');
Right now I am updating the whole content with:
xtype:'textfield',
listeners:{
keyup:{
fn:function(){
var e = this.up().down('htmleditor');
var v = 'some text <div id='mydiv'></div> some more text'
e.setValue(v);
}
}
},
xtype:'htmleditor',
...
where as I would only like to update the mydiv part only but cannot get reference to it somehow. Thanks.
If I understand correctly, the real question here is “How do I access a DIV inside an IFRAME from its parent document?”
I haven’t used EXT JS for anything, so I don’t know its syntax. But here it is in basic JavaScript.
First, the document in the IFRAME:
And then the parent document:
The key is this:
That lets you get access to the document object of the IFRAME, after which you can use it as normal.