]> git.pond.sub.org Git - eow/blob - static/dojo-release-1.1.1/dojox/dtl/demos/demo_Tree.html
add Dojo 1.1.1
[eow] / static / dojo-release-1.1.1 / dojox / dtl / demos / demo_Tree.html
1 <html>
2         <head>
3                         <title>Demo to show recursion in DTL</title>
4                         <script type="text/javascript" src="../../../dojo/dojo.js"
5                                 djConfig="isDebug: true, parseOnLoad: true"></script>
6                         <script type="text/javascript" src="../../../dijit/dijit.js"></script>
7                         <script type="text/javascript">
8                                         dojo.require("dojox.dtl._HtmlTemplated");
9                                         dojo.require("dojo.data.ItemFileReadStore");
10                                         dojo.require("dojo.parser");
11
12                                         dojo.declare("demo.Tree", [dijit._Widget, dojox.dtl._HtmlTemplated], {
13                                                 store: new dojo.data.ItemFileReadStore({ url: dojo.moduleUrl("dijit.tests._data", "countries.json") }),
14                                                 countrychildren: dojo.moduleUrl("dojox.dtl.demos.templates", "countrychildren.html"),
15                                                 postCreate: function(){
16                                                         this.store.fetch({
17                                                                 query: {
18                                                                         type: "continent"
19                                                                 },
20                                                                 onComplete: dojo.hitch(this, function(items){
21                                                                         this.items = items;
22                                                                         this.render();
23                                                                 })
24                                                         });
25                                                 },
26                                                 templateString: '{% load dojox.dtl.contrib.data %}{% bind_data items to store as countries %}<ul>{% for country in countries %}{% include countrychildren %}{% endfor %}</ul>'
27                                         });
28                         </script>
29                         <body>
30                                 <div dojoType="demo.Tree"></div>
31                         </body>
32         </head>
33 </html>