Debian Codegraph @

dojox/mobile/tests/test_RoundRectStoreList.html

raw symbols SCIP
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
5 <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no"/>
6 <meta name="apple-mobile-web-app-capable" content="yes"/>
7 <title>RoundRectStoreList</title>
8
9 <script type="text/javascript" src="../deviceTheme.js" data-dojo-config="mblThemeFiles: ['base']"></script>
10 <script type="text/javascript" src="../../../dojo/dojo.js" data-dojo-config="async: true, parseOnLoad: true"></script>
11
12 <script type="text/javascript">
13 require([
14 "dojo/_base/Deferred",
15 "dojo/store/Cache",
16 "dojo/store/JsonRest",
17 "dojo/store/Memory",
18 "dojo/store/Observable",
19 "dijit/registry",
20 "dojox/mobile/parser",
21 "dojox/mobile",
22 "dojox/mobile/compat",
23 "dojox/mobile/RoundRectStoreList"
24 ], function(Deferred, Cache, JsonRest, Memory, Observable, registry){
25 var static_data1 = [
26 { label: "Wi-Fi", icon: "images/i-icon-1.png", moveTo: "wifi" },
27 { label: "Brightness & Wallpaper", icon: "images/i-icon-2.png", moveTo: "bright" },
28 { label: "Picture Frame", icon: "images/i-icon-3.png", moveTo: "picture" },
29 { label: "General", icon: "images/i-icon-4.png", moveTo: "general", "selected": "true" },
30 { label: "Mail, Contacts, Calendars", icon: "images/i-icon-5.png", moveTo: "wifi" },
31 { label: "Safari", icon: "images/i-icon-6.png", moveTo: "bright" },
32 { label: "iPod", icon: "images/i-icon-7.png", moveTo: "picture" },
33 { label: "Video", icon: "images/i-icon-8.png", moveTo: "general" },
34 { label: "Photos", icon: "images/i-icon-9.png", moveTo: "wifi" },
35 { label: "Store", icon: "images/i-icon-10.png", moveTo: "bright" }
36 ];
37
38 var static_data2 = [
39 {label: "Apple", moveTo: "dummy"},
40 {label: "Banana", moveTo: "dummy"},
41 {label: "Cherry", moveTo: "dummy"},
42 {label: "Grape", moveTo: "dummy"},
43 {label: "Kiwi", moveTo: "dummy"},
44 {label: "Lemon", moveTo: "dummy"},
45 {label: "Melon", moveTo: "dummy"},
46 {label: "Orange", moveTo: "dummy"},
47 {label: "Peach", moveTo: "dummy"}
48 ];
49 store1 = Observable(new Memory({idProperty:"label", data: static_data1}));
50 store2 = Observable(new Memory({idProperty:"label", data: static_data2}));
51 store1.__counter = store2.__counter = 1;
52 store = store1;
53
54 // switch to the selected store
55 switchTo = function(store){
56 window.store = store;
57 registry.byId("list").setStore(store);
58 };
59 // add a new item
60 add1 = function(){
61 store.add({
62 label: "New Item "+(store.__counter++),
63 icon: "images/i-icon-1.png",
64 moveTo: "dummy"
65 });
66 };
67 // delete the added item
68 delete1 = function(){
69 if(store.__counter > 1){
70 store.remove("New Item "+(--store.__counter));
71 }
72 };
73 // modify the added item
74 var modif_counter = 0;
75 modify1 = function(){
76 if(store.__counter > 1){
77 store.put({
78 label: "New Item "+(store.__counter-1),
79 rightText: ++modif_counter + " changes"
80 });
81 }
82 };
83 });
84 </script>
85 </head>
86 <body style="visibility:hidden;">
87 <div data-dojo-type="dojox.mobile.View">
88 <h1 data-dojo-type="dojox.mobile.Heading">RoundRectStoreList</h1>
89 <ul data-dojo-type="dojox.mobile.RoundRectStoreList" id="list" data-dojo-props='store:store, query:{}'></ul>
90 <p>show the different set:<br>
91 <input type="button" value="Set1" onclick="switchTo(store1)">
92 <input type="button" value="Set2" onclick="switchTo(store2)">
93 <p>alter the object store:<br>
94 <input type="button" value="Add" onclick="add1()">
95 <input type="button" value="Delete" onclick="delete1()">
96 <input type="button" value="Modify" onclick="modify1()">
97 </div>
98 </body>
99 </html>