1, Ext.Msg.alert (string title, String Msg, [Function fn], [Object scope])
Displays a standard read-only message box with a "OK" button (similar to the basic JavaScript warning hint).
Parameters:
- Title: Caption
- Msg: Prompt Message
- fn: callback function called after message box is closed
- Scope: The range in which the callback function is executed (this reference, the default point to window)
eg
1 Ext.Msg.alert ("Hint", "No file to archive"); 2 function () {3 alert ("Cue box off"); 4 });
2. Ext.Msg.prompt (string title, String Msg, [Function fn], [Object scope], [Boolean/number multiline], [string value])
Displays a message box with a OK and cancel button that gives the user input text (similar to a JavaScript hint), which can be a single-line or multiline text box.
Parameters:
- Title: Caption
- Msg: Prompt Message
- fn: callback function called after message box is closed
- Scope: The range in which the callback function is executed (this reference, the default point to window)
- Multiline: Create a multiline text box for true when using the Defaulttextheight property, or a text box in PX-height unit, default to False
- Value: The default value of the text INPUT element, which defaults to " "
eg
1 function (btn, text) {2 if (btn = = ' OK ') {3 Ext.Msg.alert ("Result", "button:" + btn + "<br> input:" + text); 4 }5This, the "Wuln");
3, Ext.Msg.confirm (string title, String Msg, [Function fn], [Object scope])
Displays a confirmation message box with a "YES" and a "NO" button (similar to a JavaScript acknowledgment).
Parameters:
- Title: Caption
- Msg: Prompt Message
- fn: callback function called after message box is closed
- Scope: The range in which the callback function is executed (this reference, the default point to window)
eg
1 function (e) {2 if (e = = "Yes") {3 Ext.Msg.alert ("Prompt", "File saved successfully!") "); 4 }5this);
4, Ext.Msg.show (Object config)
Displays a new message box, or re-initializes an existing message box based on the configuration item.
Common Configuration items:
- Animel: Animation
- Buttons: button, take the following values
Ext.Msg.OK
Ext.Msg.YES
Ext.Msg.NO
Ext.Msg.CANCEL
- title: Title
- Span style= "font-family:"courier New", Courier; FONT-SIZE:12PX ">MSG: Hint message
- FN: callback function called after message box is closed
-
- width: The width of the message box, PX is
- multiline: Whether to display multiple lines of text
- closable: Whether the Close button is displayed
- icon: Icon, the value is as follows
Ext.MessageBox.INFO
Ext.MessageBox.WARNING
Ext.MessageBox.QUESTION
Ext.MessageBox.ERROR
- MaxWidth: Max width (px: default 600)
- MinWidth: Minimum width (px: default 100)
- Modal: whether modal display
- Progress: Whether the progress bar is displayed
- Progresstext: text that appears inside the progress bar when the progress is true
eg
1 Ext.Msg.show ({2 title: ' Save changes? ') , 3 Msg: ' You're closing a tab that has unsaved changes. Would to save your changes? ' , 4 Buttons:Ext.Msg.YESNOCANCEL,5 Icon:Ext.MessageBox.QUESTION6 });
1 Ext.Msg.show ({2Title: "Hint",3msg: "Please enter:",4width:400,5Multilinetrue,6Closable:false,7 Buttons:Ext.MessageBox.OK,8 Icon:Ext.MessageBox.INFO,9Fn:function(btn, text) {TenExt.Msg.alert ("Result", String.Format ("btn:ok<br> Input:" +text)); One } A});
1 Ext.Msg.show ({2Title: ' Please later ',3msg: ' Exporting ... ',4Progresstext: ' Initializing ... ',5width:400,6Progresstrue,7Closable:false8 });9 varProgress =function(w) {Ten return function () { One if(w = = 12) { A Ext.Msg.hide (); -Ext.Msg.alert (' Done ', ' Export succeeded! ')); -}Else { the varE = W/11; -Ext.Msg.updateProgress (E, Math.Round (+ * e) + '% '); - } - }; + }; - for(vari = 0; I < 13; i++) { +SetTimeout (Progress (i), I * 500); A}
ExtJS Pop-up window