Dec 04, 2008, 9:20 AM
Adding tabs to tabpanel in JavaScript
Hi, Im currently using this code to add a tab with an Ifram to a tab panel. Is there a smarter way of doing this? I mean instead of adding a Panel? Is there a tab class tat I can use?
var addTab = function(parent, tabtitle, page)
{
var IFrame;
if (page != "")
IFrame = String.format("<iframe width='100%' height='100%' src='"+page+"' frameborder='0'></iframe>");
var tab = new Ext.Panel({
title: tabtitle,
html: IFrame,
closable: true
});
parent.add(tab);
parent.setActiveTab(tab);
}
/Mikael