1 2 3 4 5 6 7 8 9 10 11 12 13 | BrowserPlugin = Ext.extend(Object, { init: function(component) { component.width = 500; component.height = 300; component.bodyCfg = { tag: 'iframe', src: component.url, cls: component.bodyCls, style: { border: '0px none' } }; } }); Ext.preg('browserPlugin', BrowserPlugin); |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | <html> <head> <title>Ext Browser Window Extension</title> <link rel="stylesheet" type="text/css" href="ext/resources/css /ext-all.css" /> <script type="text/javascript" src="ext/adapter/ext /ext-base.js"></script> <script type="text/javascript" src="ext/ext-all.js"></script> <script type="text/javascript" src="BrowserPlugin.js"></script> <script type="text/javascript"> Ext.onReady(function() { var win1, win2; var button1 = Ext.get('button1'); var button2 = Ext.get('button2'); button1.on('click', function() { if(!win1) { win1 = new Ext.Window({ title: 'Google', closeAction: 'hide', plugins: ['browserPlugin'], url: 'http://www.google.ie' }); } win1.show(this); }); button2.on('click', function() { if(!win2) { win2 = new Ext.Window({ title: 'Sencha', closeAction: 'hide', plugins: ['browserPlugin'], url: 'http://www.sencha.com' }); } win2.show(this); }); }); </script> </head> <body> <button id="button1">Show Google</button> <br /> <button id="button2">Show Sencha</button> </body> </html> |
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |