| 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 RTL</title> |
| 8 | |
| 9 | <script type="text/javascript" src="../../deviceTheme.js" data-dojo-config="'dojo-bidi': true, mblThemeFiles: ['base']"></script> |
| 10 | <script type="text/javascript" src="../../../../dojo/dojo.js" data-dojo-config="async: true, parseOnLoad: true, has: {'dojo-bidi':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 | "dojo/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 | { label: "Category 1", header: true }, |
| 27 | { label: "LTR", icon: "../images/i-icon-1.png", moveTo: "wifi", dir: "ltr" }, |
| 28 | { label: "Brightness & Wallpaper", icon: "../images/i-icon-2.png", moveTo: "bright" }, |
| 29 | { label: "Picture Frame", icon: "../images/i-icon-3.png", moveTo: "picture" }, |
| 30 | { label: "General", icon: "../images/i-icon-4.png", moveTo: "general", "selected": "true" }, |
| 31 | { label: "Mail, Contacts, Calendars", icon: "../images/i-icon-5.png", moveTo: "wifi" }, |
| 32 | { label: "Safari", icon: "../images/i-icon-6.png", moveTo: "bright" }, |
| 33 | { label: "iPod", icon: "../images/i-icon-7.png", moveTo: "picture" }, |
| 34 | { label: "Category 2", header: true }, |
| 35 | { label: "Video", icon: "../images/i-icon-8.png", moveTo: "general" }, |
| 36 | { label: "Photos", icon: "../images/i-icon-9.png", moveTo: "wifi" }, |
| 37 | { label: "Store", icon: "../images/i-icon-10.png", moveTo: "bright" } |
| 38 | ]; |
| 39 | |
| 40 | var static_data2 = [ |
| 41 | {label: "Apple", moveTo: "dummy"}, |
| 42 | {label: "LTR", moveTo: "dummy", dir: "ltr"}, |
| 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" dir="rtl"> |
| 80 | <h1 data-dojo-type="dojox.mobile.Heading">EdgeToEdgeStoreList RTL</h1> |
| 81 | <ul data-dojo-type="dojox.mobile.EdgeToEdgeStoreList" id="list" data-dojo-props='store:store, query:{}'></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> |