Debian Codegraph @

dojox/mobile/tests/test_EdgeToEdgeStoreList-itemMap.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>EdgeToEdgeStoreList</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/EdgeToEdgeStoreList"
24 ], function(Deferred, Cache, JsonRest, Memory, Observable, registry){
25 var static_data1 = [
26 { text: "Category 1", header: true },
27 { text: "Wi-Fi", profile_image_url: "images/i-icon-1.png", moveTo: "wifi" },
28 { text: "Brightness & Wallpaper", profile_image_url: "images/i-icon-2.png", moveTo: "bright" },
29 { text: "Picture Frame", profile_image_url: "images/i-icon-3.png", moveTo: "picture" },
30 { text: "General", profile_image_url: "images/i-icon-4.png", moveTo: "general", "selected": "true" },
31 { text: "Mail, Contacts, Calendars", profile_image_url: "images/i-icon-5.png", moveTo: "wifi" },
32 { text: "Safari", profile_image_url: "images/i-icon-6.png", moveTo: "bright" },
33 { text: "iPod", profile_image_url: "images/i-icon-7.png", moveTo: "picture" },
34 { text: "Category 2", header: true },
35 { text: "Video", profile_image_url: "images/i-icon-8.png", moveTo: "general" },
36 { text: "Photos", profile_image_url: "images/i-icon-9.png", moveTo: "wifi" },
37 { text: "Store", profile_image_url: "images/i-icon-10.png", moveTo: "bright" }
38 ];
39
40 var static_data2 = [
41 {label: "Apple", moveTo: "dummy"},
42 {label: "Banana", moveTo: "dummy"},
43 {label: "Cherry", moveTo: "dummy"},
44 {label: "Grape", moveTo: "dummy"},
45 {label: "Kiwi", moveTo: "dummy"},
46 {label: "Lemon", moveTo: "dummy"},
47 {label: "Melon", moveTo: "dummy"},
48 {label: "Orange", moveTo: "dummy"},
49 {label: "Peach", moveTo: "dummy"}
50 ];
51 store1 = Observable(new Memory({idProperty:"label", data: static_data1}));
52 store2 = Observable(new Memory({idProperty:"label", data: static_data2}));
53 store1.__counter = store2.__counter = 1;
54 store = store1;
55
56 // switch to the selected store
57 switchTo = function(store){
58 window.store = store;
59 registry.byId("list").setStore(store);
60 };
61 // add a new item
62 add1 = function(){
63 store.add({
64 label: "New Item "+(store.__counter++),
65 icon: "images/i-icon-1.png",
66 moveTo: "dummy"
67 });
68 };
69 // delete the added item
70 delete1 = function(){
71 if(store.__counter > 1){
72 store.remove("New Item "+(--store.__counter));
73 }
74 };
75 });
76 </script>
77 </head>
78 <body style="visibility:hidden;">
79 <div data-dojo-type="dojox.mobile.View">
80 <h1 data-dojo-type="dojox.mobile.Heading">EdgeToEdgeStoreList</h1>
81 <ul data-dojo-type="dojox.mobile.EdgeToEdgeStoreList" id="list" data-dojo-props='store:store, query:{}, itemMap:{text:"label", profile_image_url:"icon"}'></ul>
82 <p>show the different set:<br>
83 <input type="button" value="Set1" onclick="switchTo(store1)">
84 <input type="button" value="Set2" onclick="switchTo(store2)">
85 <p>alter the object store:<br>
86 <input type="button" value="Add" onclick="add1()">
87 <input type="button" value="Delete" onclick="delete1()">
88 </div>
89 </body>
90 </html>