May 07, 2012, 5:44 PM
[CLOSED] Close Button not working if window closed and reopen from another window
Hi,
In my web application I need one scenario like... from main form I need to open one popup (test1) and then from popup (test1) I need to open another popup (test2), but it should open below test1 popup. So I did something like... while open test2 from test1, hiding test1 and after load test2 showing the test1. So test1 is showing on top of test2. If I close test1 window, test2 is not closing.
Can you please let me know if any property is there to open popup window at top of all windows? if not please check what changes I need to do to work?
Master form...
In my web application I need one scenario like... from main form I need to open one popup (test1) and then from popup (test1) I need to open another popup (test2), but it should open below test1 popup. So I did something like... while open test2 from test1, hiding test1 and after load test2 showing the test1. So test1 is showing on top of test2. If I close test1 window, test2 is not closing.
Can you please let me know if any property is there to open popup window at top of all windows? if not please check what changes I need to do to work?
Master form...
<%@ 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">
<script runat="server">
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script language="javascript" type="text/javascript">
var renderWindow = function (windowConfig) {
var win = Ext.getCmp(windowConfig.id);
if (!win) {
new Ext.Window(windowConfig);
} else {
win.close();
new Ext.Window(windowConfig);
}
}
var ShowTestWindow = function () {
//alert(appid);
var windowConfig = {
id: "WinTest",
height: 150,
width: 450,
hidden: false,
closeAction: "hide",
buttonAlign: "center",
title: "Upload Test",
iconCls: "icon-pagewhitecode",
buttons: [
{
id: "btnSendClose",
text: "Close",
listeners: {
click: {
fn: function (el, e) {
Ext.getCmp('WinTest').hide();
}
}
}
}
],
autoLoad: {
url: "ExtTest1.aspx?" + new Date().getTime(),
nocache: true,
mode: "iframe",
showMask: true,
triggerEvent: "show",
reloadOnEvent: true
}
}
renderWindow(windowConfig);
}
</script>
</head>
<body>
<form id="form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" />
<ext:Viewport ID="Viewport1" runat="server" Layout="Border">
<Items>
<ext:Button ID="btnOpen" runat="server" Text="OpenWindow">
<Listeners>
<Click Handler="ShowTestWindow()" />
</Listeners>
</ext:Button>
</Items>
</ext:Viewport>
</form>
</body>
</html>
Test1 window...<%@ 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">
<script runat="server">
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script language="javascript" type="text/javascript">
var ShowTestWindow = function () {
//alert(appid);
var windowConfig = {
id: "WinTest2",
height: 180,
width: 500,
hidden: false,
closeAction: "hide",
buttonAlign: "center",
title: "Upload Test",
iconCls: "icon-pagewhitecode",
buttons: [
{
id: "btnDocsClose",
text: "Close",
listeners: {
click: {
fn: function (el, e) {
Ext.getCmp('WinTest2').hide();
}
}
}
}
],
autoLoad: {
url: "ExtTest2.aspx?" + new Date().getTime(),
nocache: true,
mode: "iframe",
showMask: true,
triggerEvent: "show",
reloadOnEvent: true
}
}
parent.renderWindow(windowConfig);
parent.Ext.getCmp("WinTest").hide();
}
</script>
</head>
<body>
<form id="form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" />
<div>
<ext:Button ID="btnOpenWindow" runat="server" Text="Open New Window">
<Listeners>
<Click Handler="ShowTestWindow()" />
</Listeners>
</ext:Button>
</div>
</form>
</body>
</html>
Test2...<%@ 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">
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
Ext.Net.X.Call("showTest1Window");
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script language="javascript" type="text/ecmascript">
var showTest1Window = function (e) {
if (parent.Ext.getCmp('WinTest') != null)
parent.Ext.getCmp('WinTest').show();
}
</script>
</head>
<body>
<form id="form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" />
<div>
</div>
</form>
</body>
</html>
Last edited by Daniil; May 10, 2012 at 12:52 PM.
Reason: [CLOSED]