| 1 |
<!DOCTYPE html> |
| 2 |
<html> |
| 3 |
<head> |
| 4 |
<meta http-equiv="Content-type" content="text/html; charset=utf-8"> |
| 5 |
<title>Test template with Repeat using different exprchars.</title> |
| 6 |
<script src="../../../../dojo/dojo.js" type="text/javascript" data-dojo-config="parseOnLoad: 0, isDebug: 1, mvc: {debugBindings: 1}"> |
| 7 |
</script> |
| 8 |
<style type="text/css"> |
| 9 |
@import "../css/app-format.css"; |
| 10 |
@import "../../../../dijit/themes/claro/claro.css"; |
| 11 |
</style> |
| 12 |
<script type="text/javascript"> |
| 13 |
require([ |
| 14 |
"dojo/parser", |
| 15 |
"dojox/mvc/getStateful", |
| 16 |
"dojox/mvc/ListController", |
| 17 |
"dojox/mvc/tests/test_templatedWidgetList/myMvcTemplated2", |
| 18 |
"dojox/mvc/WidgetList", |
| 19 |
"dojo/dom", |
| 20 |
"dojox/mvc/Group", |
| 21 |
"dojox/mvc/Output", |
| 22 |
"dijit/form/TextBox", |
| 23 |
"dojo/domReady!" |
| 24 |
], function(parser, getStateful, ListController, myMvcTemplated2, WidgetList, dom){ |
| 25 |
array = getStateful([ |
| 26 |
{ |
| 27 |
Serial: "A111", |
| 28 |
First: "Anne", |
| 29 |
Last: "Ackerman", |
| 30 |
Location: "NY", |
| 31 |
Office: "1S76", |
| 32 |
Email: "[email protected]", |
| 33 |
Tel: "123-764-8237", |
| 34 |
Fax: "123-764-8228" |
| 35 |
}, |
| 36 |
{ |
| 37 |
Serial: "B111", |
| 38 |
First: "Ben", |
| 39 |
Last: "Beckham", |
| 40 |
Location: "NY", |
| 41 |
Office: "5N47", |
| 42 |
Email: "[email protected]", |
| 43 |
Tel: "123-764-8599", |
| 44 |
Fax: "123-764-8600" |
| 45 |
}, |
| 46 |
{ |
| 47 |
Serial: "C111", |
| 48 |
First: "Chad", |
| 49 |
Last: "Chapman", |
| 50 |
Location: "CA", |
| 51 |
Office: "1278", |
| 52 |
Email: "[email protected]", |
| 53 |
Tel: "408-764-8237", |
| 54 |
Fax: "408-764-8228" |
| 55 |
} |
| 56 |
]); |
| 57 |
|
| 58 |
ctrl = new ListController({model: array}); |
| 59 |
|
| 60 |
|
| 61 |
parser.parse(); |
| 62 |
|
| 63 |
// (new WidgetList({children: array, childClz: myMvcTemplated2, childParams: { |
| 64 |
// startup: function(){ |
| 65 |
// this.labelNode.set("value", at("rel:", "Serial")); |
| 66 |
// this.inputNode.set("value", at("rel:", "First")); |
| 67 |
// this.nameInputNode.set("value", at("rel:", "First")); |
| 68 |
// this.inherited("startup", arguments); |
| 69 |
// } |
| 70 |
// }}, dom.byId("programmaticRepeat"))).startup(); |
| 71 |
|
| 72 |
(new WidgetList({children: array, childClz: myMvcTemplated2, childParams: { |
| 73 |
ctrl : ctrl |
| 74 |
}}, |
| 75 |
dom.byId("programmaticRepeat"))).startup(); |
| 76 |
|
| 77 |
(new WidgetList({children: ctrl.model, childClz: myMvcTemplated2, childParams: { |
| 78 |
ctrl : ctrl |
| 79 |
}}, |
| 80 |
dom.byId("programmaticRepeat2"))).startup(); |
| 81 |
|
| 82 |
}); |
| 83 |
</script> |
| 84 |
</head> |
| 85 |
<body class="claro" style="background-image: url(../images/master_detail.png)"> |
| 86 |
<script type="dojo/require">at: "dojox/mvc/at"</script> |
| 87 |
<div id="wrapper"> |
| 88 |
<div id="main"> |
| 89 |
<div id="leftNav"></div> |
| 90 |
<div id="mainContent"> |
| 91 |
<div> |
| 92 |
Test exprchar. Widget template test uses exprchar of # and others for template:#{this.index} etc. |
| 93 |
</div> |
| 94 |
<br/> |
| 95 |
|
| 96 |
|
| 97 |
|
| 98 |
<h1>First Repeating programmatically created template widget</h1> |
| 99 |
<div id="programmaticRepeat"></div> |
| 100 |
|
| 101 |
<h1>Second Repeating programmatically created template widget</h1> |
| 102 |
<div id="programmaticRepeat2"></div> |
| 103 |
<div data-dojo-type="dojox/mvc/Group" |
| 104 |
data-dojo-props="target: at(ctrl, 'cursor')"> |
| 105 |
<div class="row"> |
| 106 |
<div style="display: inline-block;" id="detailsBanner">Details for result index:</div> |
| 107 |
<span class="cell" id="indexOutput" |
| 108 |
data-dojo-type="dojox/mvc/Output" |
| 109 |
data-dojo-props="value: at(ctrl, 'cursorIndex')"></span> |
| 110 |
</div> |
| 111 |
<div class="row"> |
| 112 |
<label class="cell" for="firstInputx">First Name:</label> |
| 113 |
<input class="cell" id="firstInputx" data-dojo-type="dijit/form/TextBox" |
| 114 |
data-dojo-props="value: at('rel:', 'First')"> |
| 115 |
</div> |
| 116 |
<div class="row"> |
| 117 |
<label class="cell" for="lastInput">Last Name:</label> |
| 118 |
<input class="cell" id="lastInput" data-dojo-type="dijit.form.TextBox" |
| 119 |
data-dojo-props="value: at('rel:', 'Last')"> |
| 120 |
</div> |
| 121 |
</div> |
| 122 |
|
| 123 |
</div> |
| 124 |
</div> |
| 125 |
</div> |
| 126 |
</body> |
| 127 |
</html> |