-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxtype-example.html
executable file
·110 lines (91 loc) · 2.83 KB
/
xtype-example.html
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<html>
<head>
<title>Ext.Element</title>
<link rel="stylesheet" type="text/css" href="extjs/resources/css/ext-all.css" />
<style>
body{
background-color:#aeaeae;
}
#container{
background-color:#ccc;
}
</style>
<script src="extjs/adapter/ext/ext-base.js"></script>
<script src="extjs/ext-all-debug.js"></script>
<script>
Ext.BLANK_IMAGE_URL = 'extjs/resources/images/default/s.gif';
Ext.onReady(function () {
var panel1 = {
xtype : 'panel', // has explicit xtype, uses Ext.Panel
title : 'Plain Panel',
html : 'Panel with an xtype specified'
};
var panel2 = {
title : 'Plain Panel 2',
html : 'Panel with <b>no</b> xtype specified'
};
new Ext.Window({
width : 200,
height : 150,
title : 'Accordion window',
layout : 'accordion',
border : false,
layoutConfig : {
animate : true
},
items : [
panel1,
panel2
]
}).show();
// cleaner code.. you can define all XType items inline
/*
new Ext.Window({
width : 200,
height : 150,
title : 'Accordion window',
layout : 'accordion',
border : false,
layoutConfig : {
animate : true
},
items : [
{
xtype : 'panel', // has explicit xtype, uses Ext.Panel
title : 'Plain Panel',
html : 'Panel with an xtype specified'
},
{
title : 'Plain Panel 2',
html : 'Panel with <b>no</b> xtype specified'
}
]
}).show();
*/
// Example of immediately initating a Component rendering
var myPanel = new Ext.Panel({
renderTo : document.body,
height : 50,
width : 150,
title : 'Lazy rendered Panel',
frame : true
});
// Example of deferred Component rendering
var myPanel = new Ext.Panel({
height : 50,
width : 150,
title : 'Deferred rendered Panel',
frame : true
});
myPanel.render('container');
// however... NEVER renderTo/applyTo/manually render a Component
// that is a child of another Component... this has a parent-child
// relationship (called Container model) and the parent
// will manage the rendering
});
</script>
</head>
<body>
<div id="container"></div>
</body>
</html>