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
50
51
52
53
54
55
56
57
58
59
60
61
| <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">
ExtBrowserWindow = Ext.extend(Ext.Window, {
closeAction: 'hide',
width: 500,
height: 300,
title: 'Sencha',
url: 'http://www.sencha.com',
onRender: function() {
this.bodyCfg = {
tag: 'iframe',
src: this.url,
cls: this.bodyCls,
style: { border: '0px none' }
};
ExtBrowserWindow.superclass.onRender.apply(this, arguments);
}
});
Ext.onReady(function() {
var win1, win2;
var button1 = Ext.get('button1');
var button2 = Ext.get('button2');
button1.on('click', function() {
if(!win1) {
win1 = new ExtBrowserWindow({
id: '1',
title: 'Google',
url: 'http://www.google.com'
});
}
win1.show(this);
});
button2.on('click', function() {
if(!win2) {
win2 = new ExtBrowserWindow({
id: '2',
});
}
win2.show(this);
});
});
</script>
</head>
<body>
<button id="button1">Show Google</button>
<br />
<button id="button2">Show Sencha</button>
</body>
</html>
|