PDA

View Full Version : Ext.MessageBox custom button text



preyz
6 Jun 2011, 10:50 AM
I would like to use Ext.MessageBox with an input field and custom buttons. I.e. not just the default behavior of Ext.MessageBox.ptomt() with a Cancel and Ok button.

How can I...

1) Define the buttons (i.e. one or two)
2) Define the button value (i.e. "Ok", "Next", "Save", "Cancel")

I need this for prompt to collect required information. I.e. tapping the overlay to simply close the Ext.MessageBox shouldn't be possible.

Your help is much appreciated.

preyz
8 Jun 2011, 2:09 AM
Has noone ever changed the default buttons?

AndreaCammarata
8 Jun 2011, 8:03 AM
Hi preyz.
If you want to change the text of every message buttuons you can do it quickly in this way:



Ext.apply(Ext.MessageBox.YES, {text: 'Ja'});
Ext.apply(Ext.MessageBox.NO, {text: 'Nee'});
If you want define custom MessegeBox to add / remove buttons, you have to extend Ext.MessageBox class.

Hope this helps.