Debian Codegraph @

dojox/data/tests/ml/test_HtmlStore_declaratively.html

raw symbols SCIP
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2 <html>
3 <head>
4 <title>Dojox HtmlDataStore Widget</title>
5 <style>
6 @import "../../../../dijit/themes/tundra/tundra.css";
7 @import "../../../../dojo/resources/dojo.css";
8 @import "../../../../dijit/tests/css/dijitTests.css";
9 </style>
10 <script type="text/javascript">
11 djConfig = {
12 isDebug: true,
13 parseOnLoad: true
14 };
15 </script>
16 <script type="text/javascript" src="../../../../dojo/dojo.js"></script>
17 <!--
18 <script language="JavaScript" type="text/javascript">
19 dojo.require("doh.runner");
20 function registerTests() {
21 doh.register("t",
22 [
23 function testTableLoaded(t){
24 t.assertTrue(tableStore !== null);
25 t.assertTrue(tableStore !== undefined);
26 }
27 ]
28 );
29 doh.run();
30 };
31 dojo.addOnLoad(registerTests);
32 </script>
33 -->
34
35 <script language="JavaScript" type="text/javascript">
36 dojo.require("dojo.parser");
37 dojo.require("dojox.data.HtmlStore");
38 dojo.require("dijit.Tree");
39 dojo.require("dijit.form.ComboBox");
40
41 function init() {
42 var table = tableStore;
43
44 function testComplete(items, request){
45 console.debug("Completed!");
46
47 var attributes = null;
48 for(var i = 0; i < items.length; i++){
49 attributes = table.getAttributes(items[i]);
50 for(var j=0; j < attributes.length; j++){
51 console.debug("attribute: [" + attributes[j] + "] have value: " + table.getValue(items[i], attributes[j]));
52 }
53 }
54
55 }
56 table.fetch({query:{X:1}, onComplete: testComplete});
57 table.fetch({query:{X:2}, onComplete: testComplete});
58 table.fetch({query:{X:3}, onComplete: testComplete});
59 table.fetch({query:{X:4}, onComplete: testComplete});
60 table.fetch({query:{X:5}, onComplete: testComplete}); // Should be empty
61 }
62 dojo.addOnLoad(init);
63 </script>
64
65 </head>
66 <body class="tundra">
67 <h1>Dojox HtmlDataStore Widget</h1>
68 <hr/>
69 <br/>
70 <br/>
71
72 <!-- Instantiate the HtmlStore and bind it to global name tableStore -->
73 <div dojoType="dojox.data.HtmlStore" dataId="tableExample" jsId="tableStore"></div>
74 <div dojoType="dojox.data.HtmlStore" dataId="ulExample" jsId="ulStore"></div>
75 <div dojoType="dojox.data.HtmlStore" dataId="olExample" jsId="olStore"></div>
76 <div dojoType="dojox.data.HtmlStore" dataId="divExample" jsId="divStore"></div>
77
78 <!-- The table to link into with the HtmlStore-->
79 <table id="tableExample">
80 <thead>
81 <tr>
82 <th>X</th>
83 <th>Y</th>
84 <th>A</th>
85 <th>B</th>
86 </tr>
87 </thead>
88 <tbody>
89 <tr id="test">
90 <td>2</td>
91 <td>3</td>
92 <td></td>
93 <td>8</td>
94 </tr>
95 <tr>
96 <td>1</td>
97 <td>3</td>
98 <td>5</td>
99 <td>7</td>
100 </tr>
101 <tr>
102 <td>4</td>
103 <td>9</td>
104 <td>22</td>
105 <td>777</td>
106 </tr>
107 <tr>
108 <td>3231</td>
109 <td>3</td>
110 <td>535</td>
111 <td>747</td>
112 </tr>
113 </tbody>
114 </table>
115
116 <br/>
117 <br/>
118 <blockquote>
119 <b>Table Rows: <br/><i>(Just to show that the tree can determine that the tableStore works like a store).<br/>Should have three branches, where the row had attr Y value of 3.</i></b>
120 <div dojoType="dijit.Tree" id="tree" store="tableStore" query="{Y:3}"></div>
121 </blockquote>
122
123 <ul id="ulExample">
124 <li>Red</li>
125 <li>Orange</li>
126 <li>Yellow</li>
127 <li>Green</li>
128 <li>Blue</li>
129 <li>Violet</li>
130 </ul>
131
132 <label for="combo1">Unordered List in ComboBox: </label>
133 <input dojoType="dijit.form.ComboBox" value="Red" class="medium" store="ulStore" searchAttr="name" style="width: 300px;" name="ul.item1" id="combo1" >
134
135 <blockquote>
136 <b>Unordered List in Tree: <br/></b>
137 <div dojoType="dijit.Tree" id="tree2" labelAttr="name" store="ulStore" query="{name:'*'}"></div>
138 </blockquote>
139
140 <ol id="olExample">
141 <li>Every</li>
142 <li>Good</li>
143 <li>Boy</li>
144 <li>Does</li>
145 <li>Fine</li>
146 </ol>
147
148 <label for="combo2">Ordered List in ComboBox: </label>
149 <input dojoType="dijit.form.ComboBox" value="Every" class="medium" store="olStore" searchAttr="name" style="width: 300px;" name="ol.item1" id="combo2" >
150
151 <blockquote>
152 <b>Ordered List in Tree: <br/></b>
153 <div dojoType="dijit.Tree" id="tree3" labelAttr="name" store="olStore" query="{name:'*'}"></div>
154 </blockquote>
155
156
157 <div id="divExample">
158 <div><b>bold</b></div>
159 <div><i>italic</i></div>
160 <div><i>normal</i></div>
161 </div>
162
163 <label for="combo3">Div List in ComboBox: </label>
164 <input dojoType="dijit.form.ComboBox" value="bold" class="medium" store="divStore" searchAttr="name" style="width: 300px;" name="bold" id="combo3" >
165
166 <blockquote>
167 <b>Div list in tree: <br/></b>
168 <div dojoType="dijit.Tree" id="tree4" labelAttr="name" store="divStore" query="{name:'*'}"></div>
169 </blockquote>
170
171 </body>
172 </html>