1. Modify the default button text
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" > < Head Runat = "Server" > < Title > Ext. MessageBox. Show </ Title > < Link Href = "Ext-4.0.7-gpl/resources/CSS/ext-all.css" REL = "Stylesheet" Type = "Text/CSS" /> < Script SRC = "Ext-4.0.7-gpl/Bootstrap. js" Type = "Text/JavaScript" > </ Script > < Script Type = "Text/JavaScript" > Ext. onready ( Function (){ // OK Ext. MessageBox. msgbuttons [ 0 ]. Settext ( " Button 1 " ); // Yes Ext. MessageBox. msgbuttons [ 1 ]. Settext ( " Button 2 " ); // No Ext. MessageBox. msgbuttons [ 2 ]. Settext ( " Button 3 " ); // Cancel Ext. MessageBox. msgbuttons [ 3 ]. Settext ( " Button 4 " ); Ext. MessageBox. Show ({Title: " Prompt " , MSG: " Custom button text " , Modal: True , Buttons: Ext. msg. yesnocancel });}); </ Script > </ Head > < Body > </ Body > </ Html >
:
2. Dynamic Update prompt box
Call format:
Updatetext ([String text])
Parameter description:
[String text]: The displayed message content, which 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" > < Head Runat = "Server" > < Title > Dynamically update message text </ Title > < Link Href = "Ext-4.0.7-gpl/resources/CSS/ext-all.css" REL = "Stylesheet" Type = "Text/CSS" /> < Script SRC = "Ext-4.0.7-gpl/Bootstrap. js" Type = "Text/JavaScript" > </ Script > < Script Type = "Text/JavaScript" > Ext. onready ( Function (){ VaR Msgbox = Ext. MessageBox. Show ({Title: " Prompt " , MSG: " Dynamically update message text " , Modal: True , Buttons: Ext. MessageBox. OK, FN: Function () {Ext. TASKMANAGER. Stop (task );}}); // Ext. taskmanager is a function class used for scheduled execution.Program VaR Task = {Run: Function () {Msgbox. updatetext ( " Current Time: " + Ext. util. format. Date ( New Date (), " Y-m-d G: I: S " );}, Interval: 1000 }; Ext. TASKMANAGER. Start (task );}); </ Script > </ Head > < Body > </ Body > </ Html >
: