PDA

View Full Version : Adding an iframe with html to a panel doesn't work



Elfayer
9 Aug 2012, 2:31 AM
Hi,

That doesn't display anything:



'#gridNews': {
itemclick: function (item, record) {
var prev = Ext.ComponentQuery.query('#previewNews')[0];

prev.html = '<iframe src="' + record.get('new_url') + '", height="100%", width="100%">';
}
},

friend
9 Aug 2012, 4:23 AM
Try using Ext.DomHelper (http://docs.sencha.com/ext-js/4-1/#%21/api/Ext.DomHelper) to append (http://docs.sencha.com/ext-js/4-1/#%21/api/Ext.DomHelper-method-append) the iframe to the panel's body Element.

harman
9 Aug 2012, 7:15 AM
See if this works



newIFrame=document.createElement('iframe');
document.body.appendChild(newIFrame);


This will add an iframe to your window but if you want to add it to ExtJS panel
i guess you need to get to the panel object to use add method.