The following prompt boxes are displayed: Alert, confirm, prompt, and show.
1. Ext. MessageBox. Alert ()
Call format:
Alert (String title, string MSG, [function FN], [object scope])
Parameter description:
Title: The title of the prompt box.
MSG: The displayed message content.
[Function FN]: (optional) callback function.
[Object Scope]: (optional) scope of the callback function.
Return Value:
Ext. Window. MessageBox
<! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <HTML xmlns = "http://www.w3.org/1999/xhtml"> :
<! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <HTML xmlns = "http://www.w3.org/1999/xhtml">
:
Callback function:
<! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <HTML xmlns = "http://www.w3.org/1999/xhtml"> 2. Ext. MessageBox. Confirm ()
Call format:
Confirm (String title, string MSG, [function FN], [object scope])
The parameter description and return value are the same as Ext. MessageBox. Alert.
<! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <HTML xmlns = "http://www.w3.org/1999/xhtml">
:
3. Ext. MessageBox. Prompt ()
Call format:
Confirm (String title, string MSG, [function FN], [object scope], [Boolean/number multiline], [string value])
Parameter description:
[Boolean/number multiline]: If it is set to false, a single line text field will be displayed. If it is set to true, a multi-line plain area will be displayed at the default height. Alternatively, you can set the height of the text field in pixels. The default value is false.
<! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <HTML xmlns = "http://www.w3.org/1999/xhtml">
:
4. Ext. MessageBox. Wait ()
Call format:
Wait (string MSG, [String title], [object config])
Parameter description:
MSG: The displayed message content.
[String title]: The title of the prompt box, which is an optional parameter.
[Object config]: The configuration object used to configure the progress bar. It is an optional parameter.
Return Value:
Ext. Window. MessageBox
Code:
<! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <HTML xmlns = "http://www.w3.org/1999/xhtml">
:
5. Ext. MessageBox. Show ()
Common Ext. MessageBox configuration items:
| Configuration item |
Type |
Description |
| Title |
String |
Prompt box title |
| MSG |
String |
Displayed message content |
| Width |
Number |
The width of the dialog box, in PX. |
| Maxwidth |
Number |
The maximum width of the dialog box. The default value is 600px. |
| Minwidth |
Number |
The minimum width of the dialog box. The default value is 100px. |
| Closable |
Boolean |
False hides the close button in the upper-right corner. The default value is true. |
| Modal |
Boolean |
True indicates a modal window, and false indicates a non-modal window. |
| FN |
Function |
Callback Function Parameter description: Buttonid: button ID Text: Input text OPT: Specifies the configuration object of the show method. |
| Buttons |
Number/Boolean |
Button group. The default value is false. No button is displayed. |
| SS |
Boolean |
If the value is true, a progress bar is displayed. The default value is false. The progress bar needs to be rolled by the program. |
| Progresstext |
String |
Text displayed on the progress bar. The default value is "". |
| Proxydrag |
Boolean |
If the value is true, a highlight drag proxy is displayed. The default value is false. |
| Wait |
Boolean |
True: displays an automatic rolling progress bar. The default value is false. |
| Waitconfig |
Object |
Wait for the configuration object of the progress bar, which is valid when wait is set to true. |
| Prompt |
Boolean |
True: a single line text field is displayed. The default value is false. |
| Value |
String |
If prompt is set to true, the value is displayed in the text field. |
| Multiline |
Boolean |
If prompt is set to true, multiline is true to display multi-line text fields, and false to display single-line text fields |
| Defaulttextheight |
Number |
The default height of the multi-line text field. The default value is 75px. |
| Icon |
String |
A style file that provides a background image for the dialog box |
Buttons configuration items:
| Prompt box button configuration object |
Description |
| Ext. msg. Cancel |
Only one "cancel" button is displayed |
| Ext. msg. No |
Only one "no" button is displayed |
| Ext. msg. OK |
Only one "OK" button is displayed |
| Ext. msg. okcancel |
Two buttons are displayed, "OK" and "cancel" |
| Ext. msg. Yes |
Only one "yes" button is displayed |
| Ext. msg. yesno |
Two buttons, "yes" and "no", are displayed" |
| Ext. msg. yesnocancel |
Three buttons are displayed: "Yes", "no", and "cancel" |
Icon style description:
| Style Sheet |
Description |
| Ext. msg. Error |
Error icon |
| Ext. msg. Info |
Information icon |
| Ext. msg. Question |
Problem icon |
| Ext. msg. Warning |
Warning Icon |
Call format:
Show (Object config)
Parameter description:
A configuration object that contains the prompt box configuration information
Return Value:
Ext. Window. MessageBox
Code:
<! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <HTML xmlns = "http://www.w3.org/1999/xhtml">
:
EXT message box