PDA

View Full Version : [CLOSED] ext:Window: I wish know when the window is closed by 'close button' of window.



supera
May 04, 2012, 12:37 PM
Hi!

I wish know when the window is closed by 'close button' of window only.
I want to treat differently when the window is closed in code or via the close button of the window itself.
Would you like to do this in Javascript.

4198

Thanks for any help.

Daniil
May 04, 2012, 1:35 PM
Hi,

I can suggest the following solution.

Example

<%@ Page Language="C#" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Ext.NET v2 Example</title>
</head>
<body>
<ext:ResourceManager runat="server" />

<ext:Window ID="Window1" runat="server" Closable="false">
<Tools>
<ext:Tool Type="Close">
<Listeners>
<Click Handler="var win = item.ownerCt.ownerCt;
win[win.closeAction]();
alert('Window is closed by the tool');" />
</Listeners>
</ext:Tool>
</Tools>
<Listeners>
<Close Handler="alert('Window is closed programmatically.');" />
</Listeners>
</ext:Window>

<ext:Button runat="server" Text="Close">
<Listeners>
<Click Handler="App.Window1.close();" />
</Listeners>
</ext:Button>
</body>
</html>