PDA

View Full Version : [CLOSED] [#16] Problem width Ext.Msg.show in BeforeClose event of Panel



xeo4.it
Sep 28, 2012, 12:58 PM
Goodafternoon,
in my attached example I have a problem:
when the page appears, if I press button "test" for first and later I press the tab close button then the messagebox appears but if I immediately press the tab close button then the messagebox in IE is too small and unusable and in Chrome is only unusable.
Thank you.



<%@ 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 id="Head1" runat="server">
<title></title>

<script type="text/javascript" language="javascript">


var onCloseTab = function (panel, eOpts) {


Ext.Msg.show({
title: "Attention",
msg: "Test onBeforeClose",
width: 300,
icon: Ext.Msg.QUESTION,
buttons: Ext.Msg.YESNO,
minWidth: 290,
animateTarget: "TabPanel1"


});


return false;


}


var msgBoxShow = function () {


Ext.Msg.show({
title: "Test",
msg: "onClick",
width: 300,
icon: Ext.Msg.QUESTION,
buttons: Ext.Msg.YESNO,
minWidth: 290,
multiline: false
});


}


</script>


</head>
<body>
<form id="Form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" />

<br />

<ext:Button id="btnTestMsg" runat="server" Text="test">
<Listeners>
<Click Handler="msgBoxShow();" />
</Listeners>
</ext:Button>


<br />


<div>
<ext:TabPanel
ID="TabPanel1"
runat="server"
ActiveTabIndex="0"
Width="600"
Height="250"
Plain="true">
<Items>

<ext:Panel
ID="Tab2"
runat="server"
Title="Closable Tab"
Html="You can close this Tab."
BodyPadding="6"
Closable="true">
<Listeners>
<BeforeClose Fn="onCloseTab" />
</Listeners>

</ext:Panel>


</Items>
</ext:TabPanel>
</div>
</form>
</body>
</html>

Daniil
Sep 28, 2012, 4:00 PM
Hi Jimmy,

Thank you for the report. It is a known ExtJS issue.
http://www.sencha.com/forum/showthread.php?197911

For now, we can suggest to remove the "animationTarget" option or defer showing a message box.

Example

var onCloseTab = function () {
Ext.defer(function () {
Ext.Msg.show({
title: "Attention",
msg: "Test onBeforeClose",
width: 300,
icon: Ext.Msg.QUESTION,
buttons: Ext.Msg.YESNO,
minWidth: 290,
animateTarget: "TabPanel1"
});
}, 10);

return false;
};

xeo4.it
Oct 01, 2012, 7:29 AM
Thank you Daniil,
with defer the Msg.show works fine.

Jimmy

geoffrey.mcgill
Nov 16, 2012, 7:22 AM
Opened an Isssue to track this defect, see

https://github.com/extnet/Ext.NET/issues/16

Daniil
Dec 29, 2012, 9:40 AM
Hi Jimmy,

The bug appears to be not reproducible with the trunk. So, I am marking the thread as closed.

Testing your initial example you might notice a problem with a mask. An Issue for that problem has been already created.
https://github.com/extnet/Ext.NET/issues/99