| 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>Bidi Mobile test - TreeView</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, has: { 'dojo-bidi': true }"></script> |
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
<script type="text/javascript"> |
| 15 |
require([ |
| 16 |
"dojo/data/ItemFileReadStore", |
| 17 |
"dijit/tree/TreeStoreModel", |
| 18 |
"dojox/mobile/parser", |
| 19 |
"dojox/mobile", |
| 20 |
"dojox/mobile/compat", |
| 21 |
"dojox/mobile/TreeView" |
| 22 |
], function(ItemFileReadStore, TreeStoreModel){ |
| 23 |
var store = new ItemFileReadStore({ |
| 24 |
/* |
| 25 |
data: { |
| 26 |
identifier: 'id', |
| 27 |
items: [{ id:"upper",path:"Upper!",type:"bidi", undefined: "Root!", children:[{_reference:"first"}, {_reference:"second"}, {_reference:"third"}] }, |
| 28 |
{id:"first",path:"first",type:"", undefined: "שלום world!"}, |
| 29 |
{id:"second",path:"second",type:"",undefined: "Hello world!"}, |
| 30 |
{id:"third",path:"third",type:"",undefined: "Hello עולם!"}] |
| 31 |
} |
| 32 |
}); |
| 33 |
*/ |
| 34 |
data: { |
| 35 |
identifier: 'id', |
| 36 |
items: [{ id:"ltr",path:"ltr",type:"ltr", undefined: "Ltr", children:[{_reference:"first"}, {_reference:"second"}, {_reference:"third"}] }, |
| 37 |
{ id:"rtl",path:"rtl",type:"rtl", undefined: "Rtl", children:[{_reference:"first"}, {_reference:"second"}, {_reference:"third"}] }, |
| 38 |
{ id:"auto",path:"auto",type:"auto", undefined: "Auto", children:[{_reference:"first"}, {_reference:"second"}, {_reference:"third"}] }, |
| 39 |
{ id:"ltr2",path:"ltr2",type:"ltr2", undefined: "Ltr2", children:[{_reference:"first"}, {_reference:"second"}, {_reference:"third"}] }, |
| 40 |
{ id:"rtl2",path:"rtl2",type:"rtl2", undefined: "Rtl2", children:[{_reference:"first"}, {_reference:"second"}, {_reference:"third"}] }, |
| 41 |
{ id:"auto2",path:"auto2",type:"auto2", undefined: "Auto2", children:[{_reference:"first"}, {_reference:"second"}, {_reference:"third"}] }, |
| 42 |
|
| 43 |
{id:"first",path:"first",type:"", undefined: "שלום world!"}, |
| 44 |
{id:"second",path:"second",type:"",undefined: "Hello world!"}, |
| 45 |
{id:"third",path:"third",type:"",undefined: "Hello עולם!"}] |
| 46 |
} |
| 47 |
}); |
| 48 |
|
| 49 |
treeModelLtr1 = new TreeStoreModel({ |
| 50 |
store: store, |
| 51 |
rootLabel: "שלום World !", |
| 52 |
childrenAttrs: ["children"], |
| 53 |
newItemIdAttr: "path", |
| 54 |
query:{type:'ltr'} |
| 55 |
}); |
| 56 |
|
| 57 |
treeModelRtl1 = new TreeStoreModel({ |
| 58 |
store: store, |
| 59 |
rootLabel: "שלום World !", |
| 60 |
childrenAttrs: ["children"], |
| 61 |
newItemIdAttr: "path", |
| 62 |
query:{type:'rtl'} |
| 63 |
}); |
| 64 |
|
| 65 |
treeModelAuto1 = new TreeStoreModel({ |
| 66 |
store: store, |
| 67 |
rootLabel: "שלום World !", |
| 68 |
childrenAttrs: ["children"], |
| 69 |
newItemIdAttr: "path", |
| 70 |
query:{type:'auto'} |
| 71 |
}); |
| 72 |
|
| 73 |
treeModelLtr2 = new TreeStoreModel({ |
| 74 |
store: store, |
| 75 |
rootLabel: "שלום World !", |
| 76 |
childrenAttrs: ["children"], |
| 77 |
newItemIdAttr: "path", |
| 78 |
query:{type:'ltr2'} |
| 79 |
}); |
| 80 |
|
| 81 |
treeModelRtl2 = new TreeStoreModel({ |
| 82 |
store: store, |
| 83 |
rootLabel: "שלום World !", |
| 84 |
childrenAttrs: ["children"], |
| 85 |
newItemIdAttr: "path", |
| 86 |
query:{type:'rtl2'} |
| 87 |
}); |
| 88 |
|
| 89 |
treeModelAuto2 = new TreeStoreModel({ |
| 90 |
store: store, |
| 91 |
rootLabel: "שלום World !", |
| 92 |
childrenAttrs: ["children"], |
| 93 |
newItemIdAttr: "path", |
| 94 |
query:{type:'auto2'} |
| 95 |
}); |
| 96 |
|
| 97 |
|
| 98 |
}); |
| 99 |
</script> |
| 100 |
|
| 101 |
<style> |
| 102 |
html,body { |
| 103 |
height: 100%; |
| 104 |
overflow: hidden; |
| 105 |
} |
| 106 |
hr { |
| 107 |
border: none; |
| 108 |
margin: 0; |
| 109 |
} |
| 110 |
|
| 111 |
</style> |
| 112 |
|
| 113 |
|
| 114 |
</head> |
| 115 |
|
| 116 |
<body style="visibility:hidden;"> |
| 117 |
<div id="group1" data-dojo-type="dojox.mobile.View" data-dojo-props='keepScrollPos:false'> |
| 118 |
|
| 119 |
<div id="view0" data-dojo-type="dojox.mobile.ScrollableView"> |
| 120 |
<h2 data-dojo-type="dojox.mobile.Heading">TreeView widget</h2> |
| 121 |
<h1 data-dojo-type="dojox.mobile.Heading">dir LTR</h1> |
| 122 |
<ul data-dojo-type="dojox.mobile.EdgeToEdgeList" > |
| 123 |
<li id="l1" data-dojo-type="dojox.mobile.ListItem" data-dojo-props='icon:"../images/LTR.png", moveTo:"view1"'>Tex Dir LTR</li> |
| 124 |
<li id="l2" data-dojo-type="dojox.mobile.ListItem" data-dojo-props='icon:"../images/RTL.png", moveTo:"view2"'>Tex Dir RTL</li> |
| 125 |
<li id="l3" data-dojo-type="dojox.mobile.ListItem" data-dojo-props='icon:"../images/auto.png", moveTo:"view3"'>Tex Dir AUTO</li> |
| 126 |
</ul> |
| 127 |
<h1 data-dojo-type="dojox.mobile.Heading">dir RTL</h1> |
| 128 |
<ul data-dojo-type="dojox.mobile.EdgeToEdgeList" > |
| 129 |
<li id="l4" data-dojo-type="dojox.mobile.ListItem" data-dojo-props='icon:"../images/LTR.png", moveTo:"view4"'>Tex Dir LTR</li> |
| 130 |
<li id="l5" data-dojo-type="dojox.mobile.ListItem" data-dojo-props='icon:"../images/RTL.png", moveTo:"view5"'>Tex Dir RTL</li> |
| 131 |
<li id="l6" data-dojo-type="dojox.mobile.ListItem" data-dojo-props='icon:"../images/auto.png", moveTo:"view6"'>Tex Dir AUTO</li> |
| 132 |
</ul> |
| 133 |
</div> |
| 134 |
|
| 135 |
|
| 136 |
<div id="view1" data-dojo-type="dojox.mobile.ScrollableView"> |
| 137 |
<h1 data-dojo-type="dojox.mobile.Heading" data-dojo-props='back:"Back", moveTo:"view0"'>Dir LTR | textDir LTR</h1> |
| 138 |
|
| 139 |
|
| 140 |
<div id="treeView1" data-dojo-type="dojox.mobile.TreeView" data-dojo-props='textDir:"ltr", model: treeModelLtr1'></div> |
| 141 |
|
| 142 |
|
| 143 |
|
| 144 |
|
| 145 |
</div> |
| 146 |
|
| 147 |
|
| 148 |
<div id="view2" data-dojo-type="dojox.mobile.ScrollableView"> |
| 149 |
<h1 data-dojo-type="dojox.mobile.Heading" data-dojo-props='back:"Back", moveTo:"view0"'>Dir LTR | textDir RTL</h1> |
| 150 |
|
| 151 |
<div id="treeView2" data-dojo-type="dojox.mobile.TreeView" data-dojo-props='textDir:"rtl", model: treeModelRtl1'></div> |
| 152 |
|
| 153 |
|
| 154 |
</div> |
| 155 |
|
| 156 |
<div id="view3" data-dojo-type="dojox.mobile.ScrollableView"> |
| 157 |
<h1 data-dojo-type="dojox.mobile.Heading" data-dojo-props='back:"Back", moveTo:"view0"'>Dir LTR | textDir AUTO</h1> |
| 158 |
|
| 159 |
<div id="treeView3" data-dojo-type="dojox.mobile.TreeView" data-dojo-props='textDir:"auto", model: treeModelAuto1'></div> |
| 160 |
|
| 161 |
</div> |
| 162 |
|
| 163 |
|
| 164 |
<div dir="rtl" id="view4" data-dojo-type="dojox.mobile.ScrollableView"> |
| 165 |
<h1 data-dojo-type="dojox.mobile.Heading" data-dojo-props='back:"Back", moveTo:"view0"'>Dir RTL | textDir LTR</h1> |
| 166 |
|
| 167 |
<div id="treeView4" data-dojo-type="dojox.mobile.TreeView" data-dojo-props='textDir:"ltr", model: treeModelLtr2'></div> |
| 168 |
</div> |
| 169 |
|
| 170 |
<div id="view5" data-dojo-type="dojox.mobile.ScrollableView"> |
| 171 |
<h1 data-dojo-type="dojox.mobile.Heading" data-dojo-props='back:"Back", moveTo:"view0"'>Dir RTL | textDir RTL</h1> |
| 172 |
|
| 173 |
<div id="treeView5" dir=rtl data-dojo-type="dojox.mobile.TreeView" data-dojo-props='textDir:"rtl", model: treeModelRtl2'></div> |
| 174 |
</div> |
| 175 |
|
| 176 |
<div dir="rtl" id="view6" data-dojo-type="dojox.mobile.ScrollableView"> |
| 177 |
<h1 data-dojo-type="dojox.mobile.Heading" data-dojo-props='back:"Back", moveTo:"view0"'>Dir RTL | textDir AUTO</h1> |
| 178 |
|
| 179 |
<div id="treeView6" data-dojo-type="dojox.mobile.TreeView" data-dojo-props='textDir:"auto", model: treeModelAuto2'></div> |
| 180 |
|
| 181 |
</div> |
| 182 |
|
| 183 |
|
| 184 |
</div> |
| 185 |
</body> |
| 186 |
</html> |