Feb 04, 2011, 11:23 AM
Add Tab to Parent from within IFrame
Hi,
We've used the AutoLoad URL on a TabPanel to load via Merge mode a new view into a panel. What we need to be able to do though is, add a new tab onto the TabPanel. From an example on this site we tried:
Cheers,
Peter
We've used the AutoLoad URL on a TabPanel to load via Merge mode a new view into a panel. What we need to be able to do though is, add a new tab onto the TabPanel. From an example on this site we tried:
var addTab = function (tabPanel, id, url, title, closable) {
var tab = tabPanel.getComponent(id);
if (!tab) {
tab = tabPanel.add({
id: id,
title: title,
closable: closable,
autoLoad: {
showMask: true,
url: url,
mode: "iframe",
maskMsg: "Loading " + url + "..."
}
});
}
tabPanel.setActiveTab(tab);
}
.. and fired an event:<ext:Button runat="server" ID="btnTest" Text="Test">
<Listeners>
<Click Handler="addTab(#{tabPnlChild2}, 'idGgl', 'http://www.google.com', 'Google', true);" />
</Listeners>
</ext:Button>
In this case it says object doesnt support this property or method on the tabPanel.getComponent(id) line. Am I doing something wrong? We're using Ext.NET, not the extjs library directly.. it occurs to me that getComponent is an extjs method, is it not? Would I need to add a reference to the .js files for this to work, or should this be ok?Cheers,
Peter