aboutsummaryrefslogtreecommitdiff
path: root/includes/js/dojox/dtl/demos/demo_NodeList.html
diff options
context:
space:
mode:
authormensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>2008-11-13 09:49:11 +0000
committermensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>2008-11-13 09:49:11 +0000
commite44a7e37b6c7b5961adaffc62b9042b8d442938e (patch)
tree95b67c356e93163467db2451f2b8cce84ed5d582 /includes/js/dojox/dtl/demos/demo_NodeList.html
parenta62b9742ee5e28bcec6872d88f50f25b820914f6 (diff)
downloadsemanticscuttle-e44a7e37b6c7b5961adaffc62b9042b8d442938e.tar.gz
semanticscuttle-e44a7e37b6c7b5961adaffc62b9042b8d442938e.tar.bz2
New feature: basic Ajax suggestion for tags and implementation of Dojo toolkit
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@151 b3834d28-1941-0410-a4f8-b48e95affb8f
Diffstat (limited to 'includes/js/dojox/dtl/demos/demo_NodeList.html')
-rw-r--r--includes/js/dojox/dtl/demos/demo_NodeList.html37
1 files changed, 37 insertions, 0 deletions
diff --git a/includes/js/dojox/dtl/demos/demo_NodeList.html b/includes/js/dojox/dtl/demos/demo_NodeList.html
new file mode 100644
index 0000000..d1ab0a8
--- /dev/null
+++ b/includes/js/dojox/dtl/demos/demo_NodeList.html
@@ -0,0 +1,37 @@
+<html>
+ <head>
+ <title>Demo using dojox.dtl._Templated</title>
+ <script type="text/javascript" src="../../../dojo/dojo.js"
+ djConfig="isDebug: true, parseOnLoad: true"></script>
+ <script type="text/javascript">
+ dojo.require("dojox.dtl.ext-dojo.NodeList");
+ dojo.require("dojox.dtl.Context");
+
+ dojo.addOnLoad(function(){
+ // First, look at the NodeList extension
+ dojo.query(".fruit").dtl(dojo.moduleUrl("dojox.dtl.demos.templates", "nodelist.html"), { items: ["apple", "banana", "pear"] });
+
+ dojo.query(".fruit2").dtl("<div><ul>{% for item in items %}<li>{{ item }}</li>{% endfor %}</ul></div", { items: ["apple", "banana", "pear"] });
+
+ // Now, create a real template object
+ var tpl = new dojox.dtl.Template(dojo.moduleUrl("dojox.dtl.demos.templates", "nodelist.html"));
+
+ // And test its update function with a dojo.query
+ tpl.update(dojo.query(".update"), dojo.moduleUrl("dojox.dtl.demos.json", "fruit.json"));
+
+ setTimeout(function(){
+ // And now test it with an ID reference
+ tpl.update("updateId", dojo.moduleUrl("dojox.dtl.demos.json", "morefruit.json"));
+ // And throw in a standard rendering just for fun
+ dojo.byId("updateId2").innerHTML = tpl.render(new dojox.dtl.Context({ items: ["pineapple", "orange", "tomato"] }));
+ }, 5000);
+ });
+ </script>
+ </head>
+ <body>
+ <div class="fruit"></div>
+ <div class="fruit2"></div>
+ <div class="update" id="updateId"></div>
+ <div class="update" id="updateId2"></div>
+ </body>
+</html>