dojox
Version:
Dojo eXtensions, a rollup of many useful sub-projects and varying states of maturity – from very stable and robust, to alpha and experimental. See individual projects contain README files for details.
100 lines (91 loc) • 2.94 kB
HTML
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Test template with Repeat using different exprchars.</title>
<script src="../../../../dojo/dojo.js" type="text/javascript" data-dojo-config="parseOnLoad: 0, isDebug: 1, mvc: {debugBindings: 1}">
</script>
<style type="text/css">
@import "../css/app-format.css";
@import "../../../../dijit/themes/claro/claro.css";
</style>
<script type="text/javascript">
require([
"dojo/parser",
"dojox/mvc/getStateful",
"dojox/mvc/ModelRefController",
"dojox/mvc/tests/test_templatedWidgetList/myMvcTemplated",
"dojox/mvc/WidgetList",
"dojo/dom",
"dojo/domReady!"
], function(parser, getStateful, ModelRefController, myMvcTemplated, WidgetList, dom){
array = getStateful([
{
Serial: "A111",
First: "Anne",
Last: "Ackerman",
Location: "NY",
Office: "1S76",
Email: "a.a@test.com",
Tel: "123-764-8237",
Fax: "123-764-8228"
},
{
Serial: "B111",
First: "Ben",
Last: "Beckham",
Location: "NY",
Office: "5N47",
Email: "b.b@test.com",
Tel: "123-764-8599",
Fax: "123-764-8600"
},
{
Serial: "C111",
First: "Chad",
Last: "Chapman",
Location: "CA",
Office: "1278",
Email: "c.c@test.com",
Tel: "408-764-8237",
Fax: "408-764-8228"
}
]);
ctrl = new ModelRefController({model: array});
parser.parse();
// (new WidgetList({children: array, childClz: myMvcTemplated, childParams: {
// startup: function(){
// this.labelNode.set("value", at("rel:", "Serial"));
// this.inputNode.set("value", at("rel:", "First"));
// this.nameInputNode.set("value", at("rel:", "First"));
// this.inherited("startup", arguments);
// }
// }}, dom.byId("programmaticRepeat"))).startup();
(new WidgetList({children: array, childClz: myMvcTemplated},
dom.byId("programmaticRepeat"))).startup();
(new WidgetList({children: ctrl.model, childClz: myMvcTemplated},
dom.byId("programmaticRepeat2"))).startup();
});
</script>
</head>
<body class="claro" style="background-image: url(../images/master_detail.png)">
<div id="wrapper">
<div id="main">
<div id="leftNav"></div>
<div id="mainContent">
<div>
Test exprchar. Widget template test uses exprchar of # and others for template:#{this.index} etc.
</div>
<br/>
<!--
<div id="container2" data-dojo-type="dojox.mvc.tests.test_templatedWidgetList.myMvcTemplated" data-dojo-props="ctrl: ctrl"></div>
-->
<h1>First Repeating programmatically created template widget</h1>
<div id="programmaticRepeat"></div>
<h1>Second Repeating programmatically created template widget</h1>
<div id="programmaticRepeat2"></div>
</div>
</div>
</div>
</body>
</html>