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

    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,246
    Vote Rating
    105
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      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,246
    Vote Rating
    105
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      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 Premium Member dawesi's Avatar
    Join Date
    Mar 2007
    Location
    Melbourne, Australia (aka GMT+10)
    Posts
    1,091
    Vote Rating
    57
    dawesi has a spectacular aura about dawesi has a spectacular aura about

      0  

    Default

    you could create an extension (apparently :-)) that allows you to extent(d) extent... hehe
    Lead Trainer / Sencha Specialist
    Community And Learning Systems

    Lead Architect
    DigitalTickets.net

  6. #6
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    105
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default

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