diff options
Diffstat (limited to 'js/dojo-1.7.2/dojox/dtl/demos/demo_Inline.html')
| -rw-r--r-- | js/dojo-1.7.2/dojox/dtl/demos/demo_Inline.html | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/js/dojo-1.7.2/dojox/dtl/demos/demo_Inline.html b/js/dojo-1.7.2/dojox/dtl/demos/demo_Inline.html new file mode 100644 index 0000000..7c16ea3 --- /dev/null +++ b/js/dojo-1.7.2/dojox/dtl/demos/demo_Inline.html @@ -0,0 +1,51 @@ +<html> + <head> + <title>Demo using dojox.dtl._DomTemplated inline in DOM</title> + <script type="text/javascript" src="../../../dojo/dojo.js" + djConfig="isDebug: true, parseOnLoad: true"></script> + <script type="text/javascript"> + dojo.require("dojo.parser"); + dojo.require("dojox.dtl.Inline"); + dojo.require("dojox.dtl.DomInline"); + + gContext = {items: ["apple", "banana", "orange"]}; + + dojo.addOnLoad(function(){ + // The Re-render each with a new item + setTimeout(function(){ + var inline = dijit.byId("inline"); + inline.context.items.push("guava"); + inline.render(); + var dominline = dijit.byId("dominline"); + dominline.context.items.push("pineapple"); + dominline.render(); + + setTimeout(function(){ + // You can define an altogether new context in either of the following ways + inline.context = {items: ["lions", "tigers", "bears"]}; + inline.render(); + dominline.render({items: ["duck", "chicken", "turkey"]}); + }, 3000); + }, 3000); + }); + </script> + </head> + <body> + <script type="text/html" dojoType="dojox.dtl.Inline" id="inline" context="{items: ['apple', 'banana', 'orange']}"> + <ul> + {% for item in items %} + <li>{{ item }}</li> + {% endfor %} + </ul> + </script> + + <!-- Use the DOM-based version with an external context --> + <script type="text/html" dojoType="dojox.dtl.DomInline" id="dominline" context="gContext"> + <ul> + {% for item in items %} + <li>{{ item }}</li> + {% endfor %} + </ul> + </script> + </body> +</html> |
