-
5 May 2009 6:11 AM #1
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
-
5 May 2009 6:21 AM #2Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,251
- Vote Rating
- 41
You can't create more buttons than the 4 default buttons, but you can rename them:
Code:Ext.Msg.buttonText.cancel = 'Logoff';
-
5 May 2009 6:56 AM #3
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 });
-
5 May 2009 6:59 AM #4Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,251
- Vote Rating
- 41
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 May 2009 7:14 AM #5Sencha - Sales Team
- Join Date
- Mar 2007
- Location
- Melbourne, Australia (aka GMT+10)
- Posts
- 738
- Vote Rating
- 6
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
-
5 May 2009 7:22 AM #6Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,251
- Vote Rating
- 41
Ext.MessageBox is a singleton with a lot of private variables, so it's almost impossible to extend.
-
6 May 2009 12:07 AM #7
Thanks to you

I used
it works gr8 doing the same purposeCode:buttons: {ok:'Ok', cancel:'LogOff'}
-
28 Mar 2012 7:52 AM #8
this NOT work on V4.... any other method?
-
4 Dec 2012 7:18 AM #9
Try this:
It changes the buttonText only for this message.Code:Ext.Msg.show({ title: 'Benutzer löschen', msg: 'Möchten Sie den Benutzer wirklich löschen? Sie können ihn auch deaktivieren.', buttonText: { yes: 'Deaktivieren', no: 'Löschen', cancel: 'Abbrechen' }, buttons: Ext.Msg.YESNOCANCEL });


Reply With Quote



