EXT扩展实例:在EXT4中检测Iframe的加载事件,并给它加上MASK

验证环境  ext-4.0.7-gpl

 

 1     Ext.onReady(function () {
 2         Ext.widget('panel', {
 3             title: 'IFrame事件',
 4              500,
 5             height: 200,
 6             items: {
 7                 xtype: 'component',
 8                 autoEl: {
 9                     tag: 'iframe',
10                     style: 'height: 100%;  100%; border: none;',
11                     src: 'http://www.baidu.com'
12                 },
13                 listeners: {
14                     load: {
15                         element: 'el',
16                         fn: function () {
17                             this.parent().unmask();
19                         }
20                     },
21                     render: function () {
22                         this.up('panel').body.mask('加载中...');
23                     }
24                 }
25             },
26             renderTo: Ext.getBody()
27         });
28     });

效果如下:

 

 

原文地址:https://www.cnblogs.com/zdkjob/p/2478538.html