Various usages of the ext.messagebox of ExtJS4

Source: Internet
Author: User

1. Ext.Msg.alert (String title,string Msg) [Ext.MsssageBox.alert (Sting title,sting msg,fn)] and The difference between the JavaScript Standard alert () is that theformer is executed asynchronously and does not affect the execution of the subsequent program (the program segment is placed in the callback function to mimic the standard alert function), the latter is synchronous execution, Will prevent the subsequent execution of the program;

2. A prompt with a confirmation button: Ext.MessegeBox.confirm (Sting title,string MSG,FN): To determine the execution of the program by the input parameter ID of FN;
3. Cue box with input function: Ext.MessageBox.prompt (Sting title,string msg, fn,[boolean/number multiline],[string value]), callback function fn (ID,MSG) where the ID is the clicked button id,msg the information entered by the user;4. A cue box with a wait progress bar: Ext.MessageBox.wait (Sting msg,[string title],[object Config]): This function is used for long-time interactions, such as: 
Ext.MessageBox.wait ("Please wait ...", "hint", {text: "Text on progress Bar"});

5. The function is very powerful the show (object config) function, the return value is a Ext.messagebox object, use the following:
1 Ext.MessageBox.show ({2Title: "Hint",3Msg: "I have three buttons",4Modaltrue,//is a modal window, or a non-modal window if false;5Prompttrue,//information that can be entered6Value: "Please enter",7     Fn:prompt,8Buttons:Ext.Msg.YESNOCANCEL,//with Yes,no,cancel three buttons;9Icon:Ext.Msg.QUESTION//The icon is a question mark, also can be: info,error,warnning;Ten});

6Change the default text for the button: Ext.messagebox.msgbuttons[i].settext (String text), (0<i<5); Description: Where msgbuttons is an array with 4 objects, The IDs are in turn ok,yes,no,cancel;
1 //re-give each button a different name2Ext.messagebox.msgbuttons[0].settext ("button 1");3Ext.messagebox.msgbuttons[1].settext ("button 2");4Ext.messagebox.msgbuttons[2].settext ("button 3");5Ext.messagebox.msgbuttons[3].settext ("button 4");6   //Create a MessageBox object and observe that the text of the button has been changed7 Ext.MessageBox.show ({8Title: "Hint",9Msg: "Custom Button",TenModaltrue, OneButtons:Ext.Msg.YESNOCANCEL//the Cue box has Yes,no and cancel three buttons A});


7 Dynamic Update Prompt box: Ext.MessageBox.updateText (String text);
1 //a MessageBox object is obtained through the show () function;2 varMsgBox =Ext.MessageBox.show ({3Title: "Hint",4msg: "Update text",5Modaltrue,//as a modal window6Buttons:Ext.Msg.OK,//the button type is OK7 });8 //Create a Task object as a configuration item for Ext.TaskManager.start ()9 varTask = {TenRunfunction(){ OneMsgbox.updatetext ("Moving Time:" +ext.util.format.date (NewDate (), "Y-m-d g:i:s A")) A     }, -interval:1000 - }; theExt.TaskManager.start (Task);

Various usages of the ext.messagebox of ExtJS4

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.