Ext. MessageBox. confirm ()
A confirmation dialog box is displayed to replace the JavaScript standard confirm () method. There are two buttons: "yes" and "no". If you provide a callback function for it, the function will be called after the button is clicked (including the push button in the upper right corner). the id of the clicked button will be passed to the callback function as a unique parameter.
Call format:
Confirm (String title, String msg, [function fn], [Object scope])
Parameter description:
Ext. MessageBox. alert (); // related content
Return Value:
Ext. MessageBox
Sample Code:
Copy codeThe Code is as follows:
<Script type = "text/javascript">
Ext. onReady (function (){
Ext. MessageBox. confirm ('hprompt ', 'click I make select', callBack );
Function callBack (id ){
Alert ('click the button id: '+ id );
}
});
</Script>
The usage of Ext. MessageBox. confirm is similar to that of alert. The confirmation dialog box is asynchronously executed without blocking. Therefore, the code that can be executed after user confirmation must be placed in the callback function. The id in the input callback function is the unique method for distinguishing the user to select. You can determine this parameter to perform different operations.