| 1 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> |
| 2 |
<html> |
| 3 |
<head> |
| 4 |
<title>Dojox HtmlDataStore Widget</title> |
| 5 |
<style> |
| 6 |
@import "../../../../dijit/themes/tundra/tundra.css"; |
| 7 |
@import "../../../../dojo/resources/dojo.css"; |
| 8 |
@import "../../../../dijit/tests/css/dijitTests.css"; |
| 9 |
</style> |
| 10 |
<script type="text/javascript"> |
| 11 |
djConfig = { |
| 12 |
isDebug: true, |
| 13 |
parseOnLoad: true |
| 14 |
}; |
| 15 |
</script> |
| 16 |
<script type="text/javascript" src="../../../../dojo/dojo.js"></script> |
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
<script language="JavaScript" type="text/javascript"> |
| 36 |
dojo.require("dojo.parser"); |
| 37 |
dojo.require("dojox.data.HtmlStore"); |
| 38 |
dojo.require("dijit.Tree"); |
| 39 |
dojo.require("dijit.form.ComboBox"); |
| 40 |
|
| 41 |
function init() { |
| 42 |
var table = tableStore; |
| 43 |
|
| 44 |
function testComplete(items, request){ |
| 45 |
console.debug("Completed!"); |
| 46 |
|
| 47 |
var attributes = null; |
| 48 |
for(var i = 0; i < items.length; i++){ |
| 49 |
attributes = table.getAttributes(items[i]); |
| 50 |
for(var j=0; j < attributes.length; j++){ |
| 51 |
console.debug("attribute: [" + attributes[j] + "] have value: " + table.getValue(items[i], attributes[j])); |
| 52 |
} |
| 53 |
} |
| 54 |
|
| 55 |
} |
| 56 |
table.fetch({query:{X:1}, onComplete: testComplete}); |
| 57 |
table.fetch({query:{X:2}, onComplete: testComplete}); |
| 58 |
table.fetch({query:{X:3}, onComplete: testComplete}); |
| 59 |
table.fetch({query:{X:4}, onComplete: testComplete}); |
| 60 |
table.fetch({query:{X:5}, onComplete: testComplete}); // Should be empty |
| 61 |
} |
| 62 |
dojo.addOnLoad(init); |
| 63 |
</script> |
| 64 |
|
| 65 |
</head> |
| 66 |
<body class="tundra"> |
| 67 |
<h1>Dojox HtmlDataStore Widget</h1> |
| 68 |
<hr/> |
| 69 |
<br/> |
| 70 |
<br/> |
| 71 |
|
| 72 |
|
| 73 |
<div dojoType="dojox.data.HtmlStore" url="table.html" dataId="tableExample" jsId="tableStore"></div> |
| 74 |
<div dojoType="dojox.data.HtmlStore" url="unorderedList.html" dataId="ulExample" jsId="ulStore"></div> |
| 75 |
<div dojoType="dojox.data.HtmlStore" url="orderedList.html" dataId="olExample" jsId="olStore"></div> |
| 76 |
<div dojoType="dojox.data.HtmlStore" url="divList.html" dataId="divExample" jsId="divStore"></div> |
| 77 |
|
| 78 |
<blockquote> |
| 79 |
<b>Table Rows: <br/><i>(Just to show that the tree can determine that the tableStore works like a store).<br/>Should have three branches, where the row had attr Y value of 3.</i></b> |
| 80 |
<div dojoType="dijit.Tree" id="tree" store="tableStore" query="{Y:3}"></div> |
| 81 |
</blockquote> |
| 82 |
|
| 83 |
<label for="combo1">Unordered List in ComboBox: </label> |
| 84 |
<input dojoType="dijit.form.ComboBox" value="Red" class="medium" store="ulStore" searchAttr="name" style="width: 300px;" name="ul.item1" id="combo1" > |
| 85 |
|
| 86 |
<blockquote> |
| 87 |
<b>Unordered List in Tree: <br/></b> |
| 88 |
<div dojoType="dijit.Tree" id="tree2" labelAttr="name" store="ulStore" query="{name:'*'}"></div> |
| 89 |
</blockquote> |
| 90 |
|
| 91 |
<label for="combo2">Ordered List in ComboBox: </label> |
| 92 |
<input dojoType="dijit.form.ComboBox" value="Every" class="medium" store="olStore" searchAttr="name" style="width: 300px;" name="ol.item1" id="combo2" > |
| 93 |
|
| 94 |
<blockquote> |
| 95 |
<b>Ordered List in Tree: <br/></b> |
| 96 |
<div dojoType="dijit.Tree" id="tree3" labelAttr="name" store="olStore" query="{name:'*'}"></div> |
| 97 |
</blockquote> |
| 98 |
|
| 99 |
|
| 100 |
<div id="divExample"> |
| 101 |
<div><b>bold</b></div> |
| 102 |
<div><i>italic</i></div> |
| 103 |
<div><i>normal</i></div> |
| 104 |
</div> |
| 105 |
|
| 106 |
<label for="combo3">Div List in ComboBox: </label> |
| 107 |
<input dojoType="dijit.form.ComboBox" value="bold" class="medium" store="divStore" searchAttr="name" style="width: 300px;" name="bold" id="combo3" > |
| 108 |
|
| 109 |
<blockquote> |
| 110 |
<b>Div list in tree: <br/></b> |
| 111 |
<div dojoType="dijit.Tree" id="tree4" labelAttr="name" store="divStore" query="{name:'*'}"></div> |
| 112 |
</blockquote> |
| 113 |
|
| 114 |
</body> |
| 115 |
</html> |