Apr 15, 2010, 8:40 AM
[CLOSED] DirectEvents inside a window
hi guys,
when I use the DirectEvents before mothed inside a window it calls the javascript function
but the DirectEvents event will run at the sametime. It doesn't look at the return from the before method.
when I use the DirectEvents before mothed inside a window it calls the javascript function
but the DirectEvents event will run at the sametime. It doesn't look at the return from the before method.
<%@ Import Namespace="System.Collections.Generic" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<%@ Import Namespace="System.Xml" %>
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
if (!X.IsAjaxRequest)
{
}
}
protected void btnTest_Clicked(object sender, DirectEventArgs e)
{
X.Msg.Alert("Error", "Run was clicked").Show();
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title></title>
<script type="text/jscript">
var checkme = function(val) {
alert(val);
if (val == 1) {
return false;
}
else {
return true;
}
}
</script>
</head>
<body>
<form id="Form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" />
<ext:Window ID="Test" runat="server" Width="200" Height="200" Modal="true">
<Items>
<ext:Button ID="btnTest" Text="Run" runat="server">
<DirectEvents>
<Click OnEvent="btnTest_Clicked" Before="checkme('1');">
</Click>
</DirectEvents>
</ext:Button>
</Items>
</ext:Window>
</form>
</body>
</html>