Hybrid View

  1. #1
    Sencha User
    Join Date
    Feb 2008
    Posts
    116
    Vote Rating
    0
    buntyindia is on a distinguished road

      0  

    Default custom button for Messagebox Show

    custom button for Messagebox Show


    Hi ,


    Can we have custom button for Messagebox Show
    I need to button with name

    OK and Logoff. If Yes, How?

    Thanks

  2. #2
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,251
    Vote Rating
    41
    Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold

      0  

    Default


    You can't create more buttons than the 4 default buttons, but you can rename them:
    Code:
    Ext.Msg.buttonText.cancel = 'Logoff';

  3. #3
    Sencha User
    Join Date
    Feb 2008
    Posts
    116
    Vote Rating
    0
    buntyindia is on a distinguished road

      0  

    Default


    Quote Originally Posted by Condor View Post
    You can't create more buttons than the 4 default buttons, but you can rename them:
    Code:
    Ext.Msg.buttonText.cancel = 'Logoff';
    where I have to right this line? I need to rename both YES, NO button to OK and LogOff

    my code is:



    Code:
    Ext.MessageBox.show({
                                   title:'Session Time Out Warning!',
                                   msg: 'Session about to expire',
                                   buttons: Ext.MessageBox.YESNO,
                                   fn: function(btn, text){
                                                if (btn == 'yes'){
                                                    Ext.Ajax.request({
                                                       url: 'some.htm'
                                                    });
                                                
                                                }
                                                if (btn == 'no'){
                                                   
                                                }
                                            },
                                   icon: Ext.MessageBox.WARNING,
                                   closable : false
                               });

  4. #4
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,251
    Vote Rating
    41
    Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold

      0  

    Default


    Before showing the dialog (and don't forget to restore the button text after you're done with this dialog).

    Why are you using the Yes and No buttons if there already is an OK button? I would use the OK and Cancel buttons and rename Cancel to Logoff (as my example did).

  5. #5
    Sencha - Sales Team dawesi's Avatar
    Join Date
    Mar 2007
    Location
    Melbourne, Australia (aka GMT+10)
    Posts
    738
    Vote Rating
    6
    dawesi will become famous soon enough

      0  

    Default


    you could create an extension (apparently :-)) that allows you to extent(d) extent... hehe
    Check out SenchaWorld.com for articles, screencasts, conference videos and more.

    Sencha Technical Training : Asia Pacific Region

    Code Validation : JSLint | JSONLint | JSONPLint

  6. #6
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,251
    Vote Rating
    41
    Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold

      0  

    Default


    Ext.MessageBox is a singleton with a lot of private variables, so it's almost impossible to extend.