forked from alosaimii/template
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathreviewCode.txt
More file actions
197 lines (184 loc) · 6.03 KB
/
reviewCode.txt
File metadata and controls
197 lines (184 loc) · 6.03 KB
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
Container that I am looking at:
http://docs.sencha.com/ext-js/4-0/#/api/Ext.layout.container.Border
code for containers:
Ext.create('Ext.panel.Panel', {
width: 500,
height: 400,
title: 'Border Layout',
layout: 'border',
items: [{
title: 'South Region is resizable',
region: 'south', // position for region
xtype: 'panel',
height: 100,
collapsible:true,
collapsed:true,
split: false,
margins: '0 5 5 5'
},{
// xtype: 'panel' implied by default
title: 'West Region is collapsible',
region:'west',
xtype: 'panel',
margins: '5 0 0 5',
width: 200,
split: true,
collapsed:true,
collapsible: true, // make collapsible
id: 'west-region-container',
layout: 'fit'
},{
title: 'Center Region',
region: 'center', // center region is required, no width/height specified
xtype: 'panel',
layout: 'fit',
margins: '5 5 0 0'
}],
renderTo: Ext.getBody()
});
Panels:
http://dev.sencha.com/deploy/ext-4.1.0-gpl/examples/panel/panel.html
HTML for panels:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Ext.Panel</title>
<link rel="stylesheet" type="text/css" href="../../resources/css/ext-all.css" />
<link rel="stylesheet" type="text/css" href="../shared/example.css" />
<link rel="stylesheet" type="text/css" href="panel.css" />
<script type="text/javascript">var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-1396058-8']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })();</script>
<script type="text/javascript" src="../../ext-all.js"></script>
<script language="javascript" src="panel.js"></script>
</head>
<body>
<h1>Ext.Panel</h1>
<p>The js is not minified so it is readable. See <a href="panel.js">panel.js</a>.</p>
</body>
</html>
JavaScript for panels:
Ext.require([
'*'
]);
Ext.onReady(function() {
var html = '<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed metus nibh, sodales a, '+
'porta at, vulputate eget, dui. Pellentesque ut nisl. Maecenas tortor turpis, interdum non, sodales non, iaculis ac, '+
'lacus. Vestibulum auctor, tortor quis iaculis malesuada, libero lectus bibendum purus, sit amet tincidunt quam turpis '+
'vel lacus. In pellentesque nisl non sem. Suspendisse nunc sem, pretium eget, cursus a, fringilla vel, urna.<br/><br/>'+
'Aliquam commodo ullamcorper erat. Nullam vel justo in neque porttitor laoreet. Aenean lacus dui, consequat eu, adipiscing '+
'eget, nonummy non, nisi. Morbi nunc est, dignissim non, ornare sed, luctus eu, massa. Vivamus eget quam. Vivamus tincidunt '+
'diam nec urna. Curabitur velit. Lorem ipsum dolor sit amet.</p>';
var configs = [{
title: 'Basic Panel',
collapsible:true,
width:400,
html: html
},{
width: 320,
height: 320,
title: 'Masked Panel with a really long title',
bodyStyle: "padding: 5px;",
html: 'Some content',
collapsible: true,
collapseDirection: Ext.Component.DIRECTION_LEFT,
listeners: {
render: function(p){
p.body.mask('Loading...');
},
delay: 50
}
},{
width: 150,
height: 150,
unstyled: true,
title: 'Panel with unstyled:true',
bodyPadding: 0,
html: 'Some content'
},{
width: 150,
height: 150,
border: false,
frame: true,
title: 'Panel with border:false',
html: 'Some content'
},{
title: 'Framed panel: Width 280/Height 180',
html: html,
collapsible: true,
frame: true,
autoScroll: true,
width: 280,
height: 180
},{
title : 'Panel as child',
width : 500,
height: 400,
layout: 'fit',
bodyStyle: 'padding:5px',
items: [
{
xtype: 'panel',
border: false,
layout: {
type: 'vbox',
align: 'stretch'
},
items: [
{
html: 'top, with no title',
height: 100,
margin: '0 0 5 0'
},{
xtype: 'panel',
title: 'test',
html: 'bottom',
flex: 1
}
]
}
]
},{
title : 'Framed panel as child',
width : 300,
height: 100,
html : null,
layout: 'fit',
items: [
{
xtype: 'panel',
title: 'Framed panel',
html : '123',
frame: true
}
]
},{
title : 'Framed panel with normal child',
width : 300,
height: 100,
html : null,
frame: true,
layout: 'fit',
items: [
{
xtype: 'panel',
title: 'Non-framed child',
html : 'Hello'
}
]
},{
title: 'Width 180/No Height',
animCollapse: true,
collapsible: true,
width: 180,
html: html
}];
Ext.each(configs, function(config) {
var element = Ext.getBody().createChild({cls: 'panel-container'});
Ext.createWidget('panel', Ext.applyIf(config, {
renderTo: element,
bodyPadding: 7
}));
});
});
extJs Samples:
http://www.sencha.com/products/extjs/examples/#sample-6