roojs-all.js
[roojs1] / examples / view / xtemplate.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2 <html>
3 <head>
4     <link rel="stylesheet" type="text/css" href="../../cssX/roojs-all.css"/>
5     <link rel="stylesheet" type="text/css" href="../../cssX/xtheme-slate.css"/>
6
7     <script type="text/javascript" src="../../roojs-all.js"></script>   
8     <script type="text/javascript" src="../../Roo/XTemplate.js"></script>   
9   
10
11 <script type="text/javascript">
12     
13 Roo.onReady(function() {
14     
15     var tpl = new Roo.XTemplate({
16        html : '<tpl for="parray">' + 
17                 '<li>{pa.format:("Y-m-d")}</li>' +
18                 
19                 '<tpl if="typeof(first_of_day) != ' + "'undefined'" + ' &&  first_of_day * 1">' +   
20                     '<li  class="change-log-day"><a ' +
21                        ' name="changedate-{changedate.format:('+
22                                 "'Y-m-d'" + ')}">{changedate.format:('+
23                                 "'d / M / Y'" + ')}</a></li>' +
24                 '</tpl>' +
25             '</tpl>'
26      
27     });
28     
29     tpl.append(Roo.get('body'),{ 
30         parray : [ 
31             {
32                 pa : new Date() 
33             },
34             {
35                 pa : new Date() 
36             }
37         ]
38     });
39      
40 });
41      
42      
43 </script>
44
45 </head>
46 <body>
47     <div id="body"></div> 
48 </body>
49 </html>