[CLOSED] X.Msg.Show with JFunction

  1. #1

    [CLOSED] X.Msg.Show with JFunction

    hi,

    in client side [js] i do use code like this:

    Ext.Msg.show({ title: 'Saving New Record Status!',
            msg: 'The new record created successfully!',
            buttons: Ext.Msg.OK, icon: Ext.MessageBox.INFO, closable:false,
            fn: function(buttonId, text) {
                switch (buttonId) {
                    case 'ok':
                        doSomething();
                        break;
                }
            }
        });
    now in code behind i don't know how let the JFunction get (buttonId) parameter passed!

    X.Msg.Show(new MessageBoxConfig
                    {
                        Title = "Validation Failed!",
                        Message = "Please contact your administrator!",
                        Icon = MessageBox.Icon.ERROR,
                        Buttons = MessageBox.Button.OK,
                        Closable = false,
                        Fn = new JFunction().???
                    });
    so can you show me how to do the buttonId part in code-behind?

    thanks,
    Last edited by Daniil; Apr 20, 2011 at 11:36 AM. Reason: [CLOSED]
  2. #2
    Hi,

    I would suggest you to use .Handler.

    Example
    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            X.Msg.Show(new MessageBoxConfig
            {
                Title = "Validation Failed!",
                Message = "Please contact your administrator!",
                Icon = MessageBox.Icon.ERROR,
                Buttons = MessageBox.Button.OK,
                Closable = false,
                Handler = @"switch (buttonId) {
                            case 'ok':
                                alert('ok');
                                break;
                          }"
            });
        }
    </script>
    
    <!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 Example</title>
    </head>
    <body>
        <form runat="server">
        <ext:ResourceManager runat="server" />
        </form>
    </body>
    </html>
  3. #3
    ok, thanks dude! mark solved!

Similar Threads

  1. Replies: 1
    Last Post: Jan 17, 2014, 3:43 PM
  2. Replies: 3
    Last Post: Mar 19, 2012, 12:35 PM
  3. Replies: 1
    Last Post: Jan 27, 2012, 11:32 AM
  4. Create new JFunction in C# is ok but not in VB
    By khoa_chung_89 in forum 1.x Help
    Replies: 2
    Last Post: Sep 30, 2011, 2:56 AM
  5. JFunction for TreeGrid from codebehind
    By rajputamit in forum 1.x Help
    Replies: 2
    Last Post: Nov 01, 2010, 7:38 AM

Tags for this Thread

Posting Permissions