Nov 21, 2012, 9:40 PM
As you can hear the TabClose with plugin options TabCloseMenu
good night,
With control "TabPanel" need fire an event with its plugin "TabCloseMenu" that giving click the options which are contained: "Close All Tabs, Close Tab, Close Other Tabs" I hear the "TabClose" to trigger I need action, there is also the "TabChange" but this does not help me because I need it to run when I click on the event close one or more tab, bone, the three options that the plugin shows me "TabCloseMenu ". Thank you very much for your attention.
Ext.net 2.0
With control "TabPanel" need fire an event with its plugin "TabCloseMenu" that giving click the options which are contained: "Close All Tabs, Close Tab, Close Other Tabs" I hear the "TabClose" to trigger I need action, there is also the "TabChange" but this does not help me because I need it to run when I click on the event close one or more tab, bone, the three options that the plugin shows me "TabCloseMenu ". Thank you very much for your attention.
Ext.net 2.0
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html>
<html>
<head id="Head1" runat="server">
<title>Adding Tabs On The Fly - Ext.NET Examples</title>
<link href="/resources/css/examples.css" rel="stylesheet" />
<ext:XScript ID="XScript1" runat="server">
<script>
var addTab = function (tabPanel, id, url, menuItem) {
var tab = tabPanel.getComponent(id);
if (!tab) {
tab = tabPanel.add({
id : id,
title : url,
closable : true,
menuItem : menuItem,
loader : {
url : url,
renderer : "frame",
loadMask : {
showMask : true,
msg : "Loading " + url + "..."
}
}
});
tab.on("activate", function (tab) {
#{MenuPanel1}.setSelection(tab.menuItem);
});
}
tabPanel.setActiveTab(tab);
};
var Close = function()
{
alert("tabClose");
};
</script>
</ext:XScript>
</head>
<body>
<form id="Form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" />
<ext:Window ID="Window1"
runat="server"
Title="Adding tab"
Width="700"
Height="500"
Icon="Link"
Layout="BorderLayout">
<Items>
<ext:MenuPanel
ID="MenuPanel1"
runat="server"
Width="200"
Region="West">
<Menu ID="Menu1" runat="server">
<Items>
<ext:MenuItem ID="MenuItem1" runat="server" Text="Ext.NET">
<Listeners>
<Click Handler="addTab(#{TabPanel1}, 'idClt', 'http://www.ext.net', this);" />
</Listeners>
</ext:MenuItem>
<ext:MenuSeparator />
<ext:MenuItem ID="MenuItem2" runat="server" Text="Ext.NET forums">
<Listeners>
<Click Handler="addTab(#{TabPanel1}, 'idGgl', 'http://forums.ext.net', this);" />
</Listeners>
</ext:MenuItem>
<ext:MenuSeparator />
<ext:MenuItem ID="MenuItem3" runat="server" Text="Sencha">
<Listeners>
<Click Handler="addTab(#{TabPanel1}, 'idExt', 'http://www.sencha.com', this);" />
</Listeners>
</ext:MenuItem>
</Items>
</Menu>
</ext:MenuPanel>
<ext:TabPanel ID="TabPanel1" runat="server" Region="Center">
<Plugins>
<ext:TabCloseMenu ID="TabCloseMenu" runat="server" CloseAllTabsText="Close All Tabs"
CloseTabText="Close Tab" CloseOthersTabsText="Close Other Tabs" />
</Plugins>
<Listeners>
<TabClose Handler="Close();" />
</Listeners>
</ext:TabPanel>
</Items>
</ext:Window>
</form>
</body>
</html>