PDA

View Full Version : Per Tab iFrames



milanz
22 Aug 2007, 3:19 PM
[COLOR=black][FONT=Verdana]I have done quite a bit of searching on the forums and on the website, but I haven

fangzhouxing
22 Aug 2007, 11:18 PM
you can do like this:


function createDynamicPanel(url, title){
var tabId = getPanelTabId(title);
oStatusBar.restore();
if (tabId){
layout.getRegion('center').showPanel(tabId);
}else{
var iframe = Ext.DomHelper.append(document.body, {tag: 'iframe', frameBorder: 0, src: url});
var panel = new Ext.ContentPanel(iframe, {title: title, fitToFrame:true, closable:true});
layout.add('center', panel);
layout.getRegion('center').hidePanel(panelResult);
}
}; //createDynamicPanel

function getPanelTabId(title) {
var tabId = null;
var len = layout.getRegion('center').panels.items.length;
for(var i = 0; i<len; i++){
if(layout.getRegion('center').panels.items[i].title === title){
tabId = layout.getRegion('center').panels.items[i].getId();
break;
}
}
return tabId;
}