案例:Extjs案例     状态:可编辑再运行    进入竖版
 运行结果 
AخA
 
1
<!DOCTYPE html>
2
<html>
3
<head>
4
   <link href="//cdn.bootcss.com/extjs/6.2.0/classic/theme-classic/resources/theme-classic-all.css" rel="stylesheet" />
5
   <script type="text/javascript" src="//cdn.bootcss.com/extjs/6.2.0/ext-all.js"></script>
6
   <script type="text/javascript">
7
      Ext.onReady(function() {
8
         Ext.create('Ext.Button', {
9
            renderTo: Ext.getElementById('msgBox'),
10
            text: 'Click Me',
11
            listeners: {
12
               click: function() {
13
                  Ext.MessageBox.confirm('Confirm', 'Are you sure you want to do this ?', callbackFunction);
14
                  function callbackFunction(btn){
15
                  if(btn == 'yes') {
16
                     Ext.Msg.alert ('Button Click', 'You clicked the Yes button');
17
                  } else {
18
                     Ext.Msg.alert ('Button Click', 'You clicked the No button');
19
                  }
20
                     
21
                  };
22
               }
23
               
24
            }
25
         });
26
      });
27
   </script>
28
</head>
29
<body>
30
   <p> Click the button for alert box </p>
31
   <div id = "msgBox" ></div>
32
</body>
33
</html>