案例: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('helloWorldPanel'),
10
               text: 'My Button',
11
               listeners: {
12
                  click: function() {
13
                     Ext.MessageBox.alert('Alert box', 'Button is clicked');  
14
                  }
15
               }
16
            });
17
         });
18
      </script> 
19
   </head>
20
   <body>
21
      <p> Please click the button to see event listener </p>
22
      <div id = 'helloWorldPanel' />   <!--  panel will be rendered here-- >
23
   </body>
24
</html>