PDA

View Full Version : Stop collapsed panel from loading html



gaumont
26 Oct 2010, 3:30 PM
Hi,

I have a accordion panel and several children panels in it. One of the children panel has "html" configured with a iframe. It seems that even this panel is collapsed, it still loads the iframe's source html, but I want it to load the iframe's src only when the panel is in expanded status. Is there a way to achieve this?

Here is the code:


Ext.onReady(function(){
var p = new Ext.Panel({
title: Ext.fly('title').dom.innerHTML
,renderTo: Ext.getBody()
,layout: 'accordion'
,width:400
,height:400
,items:[{
stateId:'first'
,title:'First'
,html: '<iframe src="./test.html" />'
},{
stateId:'second'
,title:'Second'
,html: 'Second'
}]
});
});



If I collapse the First panel and refresh the page, I still see test.html is loaded in firebug console.

Thanks!