Debian Codegraph @

dojox/mvc/tests/WidgetList_tests/test_mvc_search-results-repeat.html

raw symbols SCIP
1 <!DOCTYPE html>
2 <html style="width: 100%; height: 100%;">
3 <head>
4 <meta http-equiv="Content-type" content="text/html; charset=utf-8">
5 <title>Dojo Repeat Selection Test</title>
6
7 <style type="text/css">
8 @import "../../../../dijit/themes/dijit.css";
9 @import "../../../../dijit/themes/claro/document.css";
10 @import "../../../../dijit/tests/css/dijitTests.css";
11 @import "../css/app-format.css";
12 </style>
13
14 <!-- required: a default dijit theme: -->
15 <link id="themeStyles" rel="stylesheet"
16 href="../../../../dijit/themes/claro/claro.css" />
17
18
19 <!-- required: dojo.js -->
20 <script type="text/javascript" src="../../../../dojo/dojo.js"
21 data-dojo-config="isDebug: true, async: true, mvc: {debugBindings: true}"></script>
22
23 <script type="text/javascript">
24 require([
25 "dojo/parser",
26 "dijit/registry",
27 "dojox/mvc/getStateful",
28 "dojox/mvc/_atBindingExtension",
29 "dojox/mvc/ListController",
30 "dojox/mvc/StatefulArray",
31 "dojox/mvc/Group",
32 "dojox/mvc/Output",
33 "dojox/mvc/Templated",
34 "dojox/mvc/WidgetList",
35 "dojox/mvc/Repeat",
36 "dijit/form/Button",
37 "dijit/form/TextBox"
38 ],
39 function(parser, registry, getStateful){
40
41 setDetailsContext=function(index){
42 var ctl=registry.byId("listCtl");
43 ctl.set("cursorIndex", index);
44 };
45
46 searchRecords=getStateful({
47 "Query" : "Engineers",
48 "Results" : [{
49 "First" : "Anne",
50 "Last" : "Ackerman",
51 "Location" : "NY",
52 "Office" : "1S76",
53 "Email" : "[email protected]",
54 "Tel" : "123-764-8237",
55 "Fax" : "123-764-8228"
56 }, {
57 "First" : "Ben",
58 "Last" : "Beckham",
59 "Location" : "NY",
60 "Office" : "5N47",
61 "Email" : "[email protected]",
62 "Tel" : "123-764-8599",
63 "Fax" : "123-764-8600"
64 }, {
65 "First" : "Chad",
66 "Last" : "Chapman",
67 "Location" : "CA",
68 "Office" : "1278",
69 "Email" : "[email protected]",
70 "Tel" : "408-764-8237",
71 "Fax" : "408-764-8228"
72 }, {
73 "First" : "David",
74 "Last" : "Durham",
75 "Location" : "NJ",
76 "Office" : "C12",
77 "Email" : "[email protected]",
78 "Tel" : "514-764-8237",
79 "Fax" : "514-764-8228"
80 }, {
81 "First" : "Emma",
82 "Last" : "Eklof",
83 "Location" : "NY",
84 "Office" : "4N76",
85 "Email" : "[email protected]",
86 "Tel" : "123-764-1234",
87 "Fax" : "123-764-4321"
88 }, {
89 "First" : "Fred",
90 "Last" : "Fisher",
91 "Location" : "NJ",
92 "Office" : "V89",
93 "Email" : "[email protected]",
94 "Tel" : "514-764-8567",
95 "Fax" : "514-764-8000"
96 }, {
97 "First" : "George",
98 "Last" : "Garnett",
99 "Location" : "NY",
100 "Office" : "7S11",
101 "Email" : "[email protected]",
102 "Tel" : "123-999-8599",
103 "Fax" : "123-999-8600"
104 }, {
105 "First" : "Hunter",
106 "Last" : "Huffman",
107 "Location" : "CA",
108 "Office" : "6532",
109 "Email" : "[email protected]",
110 "Tel" : "408-874-8237",
111 "Fax" : "408-874-8228"
112 }, {
113 "First" : "Irene",
114 "Last" : "Ira",
115 "Location" : "NJ",
116 "Office" : "F09",
117 "Email" : "[email protected]",
118 "Tel" : "514-764-6532",
119 "Fax" : "514-764-7300"
120 }, {
121 "First" : "John",
122 "Last" : "Jacklin",
123 "Location" : "CA",
124 "Office" : "6701",
125 "Email" : "[email protected]",
126 "Tel" : "408-764-1234",
127 "Fax" : "408-764-4321"
128 }]
129 });
130
131 parser.parse();
132 });
133 </script>
134 </head>
135 <body class="claro"
136 style="width: 100%; height: 100%; margin: 0; padding: 0;">
137 <script type="dojo/require">at: "dojox/mvc/at"</script>
138 <span id="listCtl" data-dojo-type="dojox.mvc.ListController"
139 data-dojo-props="model: searchRecords.Results, cursorIndex: 0"></span>
140 <div id="header">
141 <div id="navigation"></div>
142 <div id="headerInsert">
143 <h1>Employee Search</h1>
144 <h2>Master Detail Example - With repeat container.</h2>
145 </div>
146 </div>
147 <div id="main">
148 <div id="leftNav"></div>
149 <div id="mainContent">
150 <!--
151 The group container denotes some logical grouping of widgets and also serves
152 to establish a parent data binding context for its children.
153 The target attribute for the outermost container obtains the binding from the
154 "page scope" itself.
155
156 <div>
157 <h1>Repeating simple text box and label</h2>
158 <div data-dojo-type="dojox/mvc/WidgetList"
159 data-dojo-props="children: searchRecords.Results"
160 data-mvc-child-type="dijit/form/TextBox"
161 data-mvc-child-props="value: at(this.target, 'First')"></div>
162 <span data-dojo-type="dojox/mvc/WidgetList"
163 data-dojo-props="children: searchRecords.Results"
164 data-mvc-child-type="dijit/_WidgetBase"
165 data-mvc-child-props="_setValueAttr: {node: 'domNode', type: 'innerText'}, value: at(this.target, 'First')"></span>
166 </div>
167 -->
168
169 <div data-dojo-type="dojox.mvc.Group"
170 data-dojo-props="target: searchRecords">
171 <div class="row">
172 <label class="cell" for="queryInput">Search for:</label>
173 <input class="cell" id="queryInput" data-dojo-type="dijit.form.TextBox"
174 data-dojo-props="value: at('rel:', 'Query')" />
175 <button type="button" data-dojo-type="dijit.form.Button"
176 data-dojo-props="onClick: function(){setSearchBanner();}">Search</button>
177 </div>
178 <div class="spacer"></div>
179
180 <div id="searchBanner">Search Results for term: Engineers</div>
181
182 <div data-dojo-type="dojox/mvc/WidgetList"
183 data-dojo-mixins="dojox/mvc/_InlineTemplateMixin"
184 data-dojo-props="children: at('rel:', 'Results')">
185 <script type="dojox/mvc/InlineTemplate">
186 <div>
187 <label class="cell">Name:</label>
188 <span data-dojo-type="dijit/_WidgetBase"
189 data-dojo-props="_setValueAttr: {node: 'domNode', type: 'innerText'}, value: ${indexAtStartup}"></span>:
190 <span data-dojo-type="dijit/form/TextBox"
191 data-dojo-props="value: at('rel:', 'First')"></span>
192 <button type="button" data-dojo-type="dijit/form/Button"
193 data-dojo-props="onClick: function(){setDetailsContext('${indexAtStartup}');}">Details</button>
194 </div>
195 </script>
196 </div>
197
198
199 <!--
200 The repeat container denotes a templated UI that operates over a collection
201 of data records.
202 The UI can be customized for each iteration using properties such as
203 listCtl cursor or cursorIndex for the iteration.
204
205 <div data-dojo-type="dojox.mvc.Repeat"
206 data-dojo-props="children: at('rel:', 'Results')">
207 <div class="row" data-dojo-type="dojox.mvc.Group"
208 data-dojo-props="target: at('rel:${this.index}')">
209 <label class="cell" for="nameInput${this.index}">Name:</label>
210 <input class="cell" data-dojo-type="dijit.form.TextBox"
211 id="nameInput${this.index}"
212 data-dojo-props="value: at('rel:', 'First')">
213 <button type="button" data-dojo-type="dijit.form.Button"
214 data-dojo-props="onClick: function(){setDetailsContext('${this.index}');}">Details</button>
215 </div>
216 </div>
217 -->
218
219 <div class="spacer"></div>
220
221 <div data-dojo-type="dojox.mvc.Group"
222 data-dojo-props="target: at('widget:listCtl', 'cursor')">
223 <div class="row">
224 <div style="display: inline-block;" id="detailsBanner">Details for result index:</div>
225 <span class="cell" id="indexOutput"
226 data-dojo-type="dojox.mvc.Output"
227 data-dojo-props="value: at('widget:listCtl', 'cursorIndex')"></span>
228 </div>
229 <div class="row">
230 <label class="cell" for="firstInput">First Name:</label>
231 <input class="cell" id="firstInput" data-dojo-type="dijit.form.TextBox"
232 data-dojo-props="value: at('rel:', 'First')">
233 </div>
234 <div class="row">
235 <label class="cell" for="lastInput">Last Name:</label>
236 <input class="cell" id="lastInput" data-dojo-type="dijit.form.TextBox"
237 data-dojo-props="value: at('rel:', 'Last')">
238 </div>
239 <div class="row">
240 <label class="cell" for="locationInput">Location:</label>
241 <input class="cell" id="locationInput"
242 data-dojo-type="dijit.form.TextBox"
243 data-dojo-props="value: at('rel:', 'Location')">
244 </div>
245 <div class="row">
246 <label class="cell" for="officeInput">Office:</label>
247 <input class="cell" id="officeInput" data-dojo-type="dijit.form.TextBox"
248 data-dojo-props="value: at('rel:', 'Office')">
249 </div>
250 <div class="row">
251 <label class="cell" for="emailInput">Email:</label>
252 <input class="cell" id="emailInput" data-dojo-type="dijit.form.TextBox"
253 data-dojo-props="value: at('rel:', 'Email')">
254 </div>
255 <div class="row">
256 <label class="cell" for="telInput">Telephone:</label>
257 <input class="cell" id="telInput" data-dojo-type="dijit.form.TextBox"
258 data-dojo-props="value: at('rel:', 'Tel')">
259 </div>
260 <div class="row">
261 <label class="cell" for="faxInput">Fax:</label>
262 <input class="cell" id="faxInput" data-dojo-type="dijit.form.TextBox"
263 data-dojo-props="value: at('rel:', 'Fax')">
264 </div>
265 </div>
266 </div>
267 </div>
268 </div>
269 </body>
270 </html>