Adding an event to Msg button from a client side?

  1. #1

    Adding an event to Msg button from a client side?

    I have looked in many forums but can not find how to do this.
    I need to add an event to the button of a MessageBox
    Following is the code:
    <DirectEvents>
    <Click OnEvent "btnRecord_Click" Before = "Ext.Msg.wait ('Saving changes ...',' Recording');"
                                          Success = "Ext.Msg.show ({
                                title: 'Save'
                                msg: 'Your changes were saved successfully',
                                buttons: Ext.Msg.OK
    
                             }); "
    
    </Click>
    </DirectEvents>
    By clicking OK, I reload my GridPanel this, or need to add an event to this button, but I can not. I have to do this at client side.

    thank you
    Last edited by Daniil; Jan 24, 2012 at 5:58 AM. Reason: Please use [CODE] tags
  2. #2
    Hi,

    Please set up "fn" config option.

    Example
    Ext.Msg.show ({
        title   : 'Save',
        msg     : 'Your changes were saved successfully',
        buttons : Ext.Msg.OK,
        fn      : function (btn) {
            alert(btn);
        }
    });
    See also
    http://docs.sencha.com/ext-js/3-4/#!...sg-method-show
  3. #3
    Thank you, this worked, but gostoria to add this event to refresh the GridPanel by clicking the OK button
    I am doing as follows:
      Success = "Ext.Msg.show ({
                                title: 'Save'
                                msg: 'Your changes were saved successfully',
                                buttons: Ext.Msg.OK,
                                 fn: function (btn) {
                                          #{GridPanel1}.refresh();
                                             }
                                    
                             }); "
    But that does not work.
    Last edited by Daniil; Jan 24, 2012 at 11:43 AM. Reason: Please use [CODE] tags
  4. #4
    I think you need to start a new thread, because the initial question has been answered. And the new one is not related to the initial one.

Similar Threads

  1. Replies: 1
    Last Post: Nov 18, 2011, 5:29 PM
  2. [CLOSED] Adding node dynamicaly to treegrid on client side
    By bakardi in forum 1.x Legacy Premium Help
    Replies: 8
    Last Post: Oct 22, 2011, 6:38 AM
  3. Replies: 1
    Last Post: Dec 01, 2010, 5:14 PM
  4. client side script after ajax event
    By [WP]joju in forum 1.x Help
    Replies: 0
    Last Post: Nov 25, 2009, 2:30 AM
  5. Replies: 2
    Last Post: Mar 08, 2009, 10:11 AM

Posting Permissions