dojox
Version:
Dojo eXtensions, a rollup of many useful sub-projects and varying states of maturity – from very stable and robust, to alpha and experimental. See individual projects contain README files for details.
214 lines (178 loc) • 10.3 kB
HTML
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no"/>
<meta name="apple-mobile-web-app-capable" content="yes"/>
<title>Bidi Mobile test - EdgeToEdgeDataList</title>
<script type="text/javascript" src="../../deviceTheme.js" data-dojo-config="mblThemeFiles: ['base']"></script>
<script type="text/javascript" src="../../../../dojo/dojo.js" data-dojo-config="async: true, parseOnLoad: true, mblAlwaysHideAddressBar: true, has: { 'dojo-bidi': true }"></script>
<script type="text/javascript">
require([
"dojo/data/ItemFileWriteStore",
"dijit/registry",
"doh/runner",
"dojo/dom",
"dojo/ready",
"dojo/query",
"dojo/_base/lang",
"dojox/mobile/parser",
"dojox/mobile",
"dojox/mobile/compat",
"dojox/mobile/ScrollableView",
"dojox/mobile/RoundRectDataList",
"dojox/mobile/EdgeToEdgeDataList"
], function(ItemFileWriteStore, registry, runner, dom, ready, query, lang){
var static_data1 = {
items: [
{ label: "Hello world!", icon: "../images/i-icon-1.png", moveTo: "wifi" },
{ label: "שלום עולם!", icon: "../images/i-icon-2.png", moveTo: "bright" },
{ label: "Hello עולם!", icon: "../images/i-icon-3.png", moveTo: "picture" },
{ label: "שלום World!", icon: "../images/i-icon-5.png", moveTo: "wifi" }
]
};
var static_data2 = {
items: [
{label: "שלום World!", moveTo: "dummy"},
{label: "Hello עולם!", moveTo: "dummy"},
{label: "שלום עולם!", moveTo: "dummy"},
{label: "Hello world!", moveTo: "dummy"}
]
};
store1 = new ItemFileWriteStore({data: lang.clone(static_data1), clearOnClose: true});
store2 = new ItemFileWriteStore({data: lang.clone(static_data2), clearOnClose: true});
store = store1;
var newItems = [[],[]];
// switch to the selected store
switchTo = function(store){
window.store = store;
registry.byId("roundrect_list1").setStore(store);
registry.byId("edgetoedge_list1").setStore(store);
registry.byId("roundrect_list2").setStore(store);
registry.byId("edgetoedge_list2").setStore(store);
registry.byId("roundrect_list3").setStore(store);
registry.byId("edgetoedge_list3").setStore(store);
registry.byId("roundrect_list4").setStore(store);
registry.byId("edgetoedge_list4").setStore(store);
registry.byId("roundrect_list5").setStore(store);
registry.byId("edgetoedge_list5").setStore(store);
registry.byId("roundrect_list6").setStore(store);
registry.byId("edgetoedge_list6").setStore(store);
};
// add a new item
add1 = function(){
var item = store.newItem({label: "שלום World (new)!", moveTo: "dummy"});
newItems[(store == store1) ? 1 : 0].push(item);
};
});
</script>
</head>
<body style="visibility:hidden;">
<div id="group1" data-dojo-type="dojox.mobile.View" data-dojo-props='keepScrollPos:false'><!-- keepScrollPos=false is to improve performance --> <div id="view0" data-dojo-type="dojox.mobile.ScrollableView">
<h2 data-dojo-type="dojox.mobile.Heading">EdgeToEdgeDataList widget</h2>
<h1 data-dojo-type="dojox.mobile.Heading">dir LTR</h1>
<ul data-dojo-type="dojox.mobile.EdgeToEdgeList" >
<li id="l1" data-dojo-type="dojox.mobile.ListItem" data-dojo-props='icon:"../images/LTR.png", moveTo:"view1"'>Tex Dir LTR</li>
<li id="l2" data-dojo-type="dojox.mobile.ListItem" data-dojo-props='icon:"../images/RTL.png", moveTo:"view2"'>Tex Dir RTL</li>
<li id="l3" data-dojo-type="dojox.mobile.ListItem" data-dojo-props='icon:"../images/auto.png", moveTo:"view3"'>Tex Dir AUTO</li>
</ul>
<h1 data-dojo-type="dojox.mobile.Heading">dir RTL</h1>
<ul data-dojo-type="dojox.mobile.EdgeToEdgeList" >
<li id="l4" data-dojo-type="dojox.mobile.ListItem" data-dojo-props='icon:"../images/LTR.png", moveTo:"view4"'>Tex Dir LTR</li>
<li id="l5" data-dojo-type="dojox.mobile.ListItem" data-dojo-props='icon:"../images/RTL.png", moveTo:"view5"'>Tex Dir RTL</li>
<li id="l6" data-dojo-type="dojox.mobile.ListItem" data-dojo-props='icon:"../images/auto.png", moveTo:"view6"'>Tex Dir AUTO</li>
</ul>
</div>
<div id="view1" data-dojo-type="dojox.mobile.ScrollableView">
<h1 data-dojo-type="dojox.mobile.Heading" data-dojo-props='back:"Back", moveTo:"view0"'>Dir LTR | textDir LTR</h1>
<h2 data-dojo-type="dojox.mobile.Heading">RoundRectDataList</h2>
<ul data-dojo-type="dojox.mobile.RoundRectDataList" id="roundrect_list1" data-dojo-props='textDir:"ltr", store:store, query:{label: "*"}'></ul>
<h2 data-dojo-type="dojox.mobile.Heading">EdgeToEdgeDataList</h2>
<ul data-dojo-type="dojox.mobile.EdgeToEdgeDataList" id="edgetoedge_list1" data-dojo-props='textDir:"ltr", store:store, query:{label: "*"}'></ul>
<table border="1">
<tr><th>Show the different set</th><th>Alter the object store</th></tr>
<tr><td>
<input type="button" value="Set1" onclick="switchTo(store1)">
<input type="button" value="Set2" onclick="switchTo(store2)">
</td><td>
<input type="button" value="Add" onclick="add1()">
</td></tr></table>
</div>
<div id="view2" data-dojo-type="dojox.mobile.ScrollableView">
<h1 data-dojo-type="dojox.mobile.Heading" data-dojo-props='back:"Back", moveTo:"view0"'>Dir LTR | textDir RTL</h1>
<h2 data-dojo-type="dojox.mobile.Heading">RoundRectDataList</h2>
<ul data-dojo-type="dojox.mobile.RoundRectDataList" id="roundrect_list2" data-dojo-props='textDir:"rtl", store:store, query:{label: "*"}'></ul>
<h2 data-dojo-type="dojox.mobile.Heading">EdgeToEdgeDataList</h2>
<ul data-dojo-type="dojox.mobile.EdgeToEdgeDataList" id="edgetoedge_list2" data-dojo-props='textDir:"rtl", store:store, query:{label: "*"}'></ul>
<table border="1">
<tr><th>Show the different set</th><th>Alter the object store</th></tr>
<tr><td>
<input type="button" value="Set1" onclick="switchTo(store1)">
<input type="button" value="Set2" onclick="switchTo(store2)">
</td><td>
<input type="button" value="Add" onclick="add1()">
</td></tr></table>
</div>
<div id="view3" data-dojo-type="dojox.mobile.ScrollableView">
<h1 data-dojo-type="dojox.mobile.Heading" data-dojo-props='back:"Back", moveTo:"view0"'>Dir LTR | textDir AUTO</h1>
<h2 data-dojo-type="dojox.mobile.Heading">RoundRectDataList</h2>
<ul data-dojo-type="dojox.mobile.RoundRectDataList" id="roundrect_list3" data-dojo-props='textDir:"auto", store:store, query:{label: "*"}'></ul>
<h2 data-dojo-type="dojox.mobile.Heading">EdgeToEdgeDataList</h2>
<ul data-dojo-type="dojox.mobile.EdgeToEdgeDataList" id="edgetoedge_list3" data-dojo-props='textDir:"auto", store:store, query:{label: "*"}'></ul>
<table border="1">
<tr><th>Show the different set</th><th>Alter the object store</th></tr>
<tr><td>
<input type="button" value="Set1" onclick="switchTo(store1)">
<input type="button" value="Set2" onclick="switchTo(store2)">
</td><td>
<input type="button" value="Add" onclick="add1()">
</td></tr></table>
</div>
<div id="view4" data-dojo-type="dojox.mobile.ScrollableView">
<h1 data-dojo-type="dojox.mobile.Heading" data-dojo-props='back:"Back", moveTo:"view0"'>Dir RTL | textDir LTR</h1>
<h2 data-dojo-type="dojox.mobile.Heading">RoundRectDataList</h2>
<ul data-dojo-type="dojox.mobile.RoundRectDataList" dir=rtl id="roundrect_list4" data-dojo-props='textDir:"ltr", store:store, query:{label: "*"}'></ul>
<h2 data-dojo-type="dojox.mobile.Heading">EdgeToEdgeDataList</h2>
<ul data-dojo-type="dojox.mobile.EdgeToEdgeDataList" dir=rtl id="edgetoedge_list4" data-dojo-props='textDir:"ltr", store:store, query:{label: "*"}'></ul>
<table border="1">
<tr><th>Show the different set</th><th>Alter the object store</th></tr>
<tr><td>
<input type="button" value="Set1" onclick="switchTo(store1)">
<input type="button" value="Set2" onclick="switchTo(store2)">
</td><td>
<input type="button" value="Add" onclick="add1()">
</td></tr></table>
</div>
<div dir="rtl" id="view5" data-dojo-type="dojox.mobile.ScrollableView">
<h1 data-dojo-type="dojox.mobile.Heading" data-dojo-props='back:"Back", moveTo:"view0"'>Dir RTL | textDir RTL</h1>
<h2 data-dojo-type="dojox.mobile.Heading">RoundRectDataList</h2>
<ul data-dojo-type="dojox.mobile.RoundRectDataList" id="roundrect_list5" data-dojo-props='textDir:"rtl", store:store, query:{label: "*"}'></ul>
<h2 data-dojo-type="dojox.mobile.Heading">EdgeToEdgeDataList</h2>
<ul data-dojo-type="dojox.mobile.EdgeToEdgeDataList" id="edgetoedge_list5" data-dojo-props='textDir:"rtl", store:store, query:{label: "*"}'></ul>
<table border="1">
<tr><th>Show the different set</th><th>Alter the object store</th></tr>
<tr><td>
<input type="button" value="Set1" onclick="switchTo(store1)">
<input type="button" value="Set2" onclick="switchTo(store2)">
</td><td>
<input type="button" value="Add" onclick="add1()">
</td></tr></table>
</div>
<div id="view6" dir="rtl" data-dojo-type="dojox.mobile.ScrollableView">
<h1 data-dojo-type="dojox.mobile.Heading" data-dojo-props='back:"Back", moveTo:"view0"'>Dir RTL | textDir AUTO</h1>
<h2 data-dojo-type="dojox.mobile.Heading">RoundRectDataList</h2>
<ul data-dojo-type="dojox.mobile.RoundRectDataList" id="roundrect_list6" data-dojo-props='textDir:"auto", store:store, query:{label: "*"}'></ul>
<h2 data-dojo-type="dojox.mobile.Heading">EdgeToEdgeDataList</h2>
<ul data-dojo-type="dojox.mobile.EdgeToEdgeDataList" id="edgetoedge_list6" data-dojo-props='textDir:"auto", store:store, query:{label: "*"}'></ul>
<table border="1">
<tr><th>Show the different set</th><th>Alter the object store</th></tr>
<tr><td>
<input type="button" value="Set1" onclick="switchTo(store1)">
<input type="button" value="Set2" onclick="switchTo(store2)">
</td><td>
<input type="button" value="Add" onclick="add1()">
</td></tr></table>
</div>
</div>
</body>
</html>