-
Notifications
You must be signed in to change notification settings - Fork 0
/
example1.html
35 lines (34 loc) · 1.23 KB
/
example1.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
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8" />
<title>Simple Templates [Ext JS Templating Magic]</title>
<script src="ext-3.3.1/adapter/ext/ext-base.js"></script>
<script src="ext-3.3.1/ext-all.js"></script>
<script src="examples.js"></script>
<link rel="stylesheet" type="text/css" href="ext-3.3.1/resources/css/ext-all.css" />
<link rel="stylesheet" type="text/css" href="examples.css" />
<script>
Ext.onReady(function() {
// simple template with array data
var template1 = new Ext.Template("<h1>Hello {0}!</h1>");
template1.append('content', ['World']);
// simple template with object data
var template2 = new Ext.Template("<h1>{greeting} {name}!</h1>");
template2.append('content', {greeting: 'Good morning', name: 'Earth'});
});
</script>
</head>
<body id="example1">
<ul id="page-nav">
<li><a rel="index" href="#">index</a></li>
<li><a rel="prev" href="#">←</a></li>
<li><a rel="next" href="#">→</a></li>
</ul>
<h1><a rel="source" href="#">view source</a>Simple Templates</h1>
<div id="content"></div>
<div id="footer">
Stefan Gehrig, 2011, to accompany the article "Ext JS templating magic" in <a href="http://jsmag.com"><jsmag></a> 05/2011
</div>
</body>
</html>