[CLOSED] DirectEvents inside a window

  1. #1

    [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.

    
    
    
    
    
    
    
    <%@ 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>
  2. #2

    RE: [CLOSED] DirectEvents inside a window

    Hi,

    You forgot 'return' in the Before
    Before="return checkme('1');"
  3. #3

    RE: [CLOSED] DirectEvents inside a window

    Thanks

Similar Threads

  1. Replies: 0
    Last Post: Jun 13, 2012, 8:47 AM
  2. Replies: 2
    Last Post: Oct 11, 2011, 1:15 PM
  3. [CLOSED] ClientID inside DirectEvents
    By krzak in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Mar 01, 2011, 10:32 AM
  4. [CLOSED] Problem to close Window which has another Window inside
    By asztern in forum 1.x Legacy Premium Help
    Replies: 8
    Last Post: Dec 21, 2010, 5:33 PM
  5. Replies: 9
    Last Post: Oct 07, 2010, 6:27 PM

Posting Permissions