PDA

View Full Version : [CLOSED] how to open a new tab page????



tobros
Nov 01, 2013, 8:53 AM
by Clicking a button of nested page in tabpanel . how to open a new tab page .

out of main page is javascript as follow



<ext:XScript ID="XScript1" runat="server">
<script type="text/javascript">
var addTab = function (tabPanel, id, text, url, leaf) {
var tab = tabPanel.getComponent(id);

if (!tab && leaf) {
tab = tabPanel.add({
id: id,
title: text,
closable: true,
loader: {
url: url,
renderer: "frame",
loadMask: {
showMask: true,
msg: "正在打开 " + text + "..."
}
}
});


}

tabPanel.setActiveTab(tab);
}
</script>
</ext:XScript>

Daniil
Nov 01, 2013, 9:30 AM
Hi @tobros,

You can access a parent page from its iframe by a "parent" reference.

parent.addTab(...);