aboutsummaryrefslogtreecommitdiff
path: root/includes/js/dojox/data/tests/ml/test_HtmlTableStore_declaratively.html
diff options
context:
space:
mode:
authormensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>2008-11-13 09:49:11 +0000
committermensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>2008-11-13 09:49:11 +0000
commite44a7e37b6c7b5961adaffc62b9042b8d442938e (patch)
tree95b67c356e93163467db2451f2b8cce84ed5d582 /includes/js/dojox/data/tests/ml/test_HtmlTableStore_declaratively.html
parenta62b9742ee5e28bcec6872d88f50f25b820914f6 (diff)
downloadsemanticscuttle-e44a7e37b6c7b5961adaffc62b9042b8d442938e.tar.gz
semanticscuttle-e44a7e37b6c7b5961adaffc62b9042b8d442938e.tar.bz2
New feature: basic Ajax suggestion for tags and implementation of Dojo toolkit
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@151 b3834d28-1941-0410-a4f8-b48e95affb8f
Diffstat (limited to 'includes/js/dojox/data/tests/ml/test_HtmlTableStore_declaratively.html')
-rw-r--r--includes/js/dojox/data/tests/ml/test_HtmlTableStore_declaratively.html120
1 files changed, 120 insertions, 0 deletions
diff --git a/includes/js/dojox/data/tests/ml/test_HtmlTableStore_declaratively.html b/includes/js/dojox/data/tests/ml/test_HtmlTableStore_declaratively.html
new file mode 100644
index 0000000..f69ba68
--- /dev/null
+++ b/includes/js/dojox/data/tests/ml/test_HtmlTableStore_declaratively.html
@@ -0,0 +1,120 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<title>Dojox HtmlDataStore Widget</title>
+<style>
+ @import "../../../../dijit/themes/tundra/tundra.css";
+ @import "../../../../dojo/resources/dojo.css";
+ @import "../../../../dijit/tests/css/dijitTests.css";
+</style>
+<script type="text/javascript">
+ djConfig = {
+ isDebug: true,
+ parseOnLoad: true
+ };
+</script>
+<script type="text/javascript" src="../../../../dojo/dojo.js"></script>
+<!--
+<script language="JavaScript" type="text/javascript">
+ dojo.require("doh.runner");
+ function registerTests() {
+ doh.register("t",
+ [
+ function testTableLoaded(t){
+ t.assertTrue(tableStore !== null);
+ t.assertTrue(tableStore !== undefined);
+ }
+ ]
+ );
+ doh.run();
+ };
+ dojo.addOnLoad(registerTests);
+</script>
+-->
+
+<script language="JavaScript" type="text/javascript">
+ dojo.require("dojo.parser");
+ dojo.require("dojox.data.HtmlTableStore");
+ dojo.require("dijit.Tree");
+
+ function init() {
+ var table = tableStore;
+
+ function testComplete(items, request){
+ console.debug("Completed!");
+
+ var attributes = null;
+ for(var i = 0; i < items.length; i++){
+ attributes = table.getAttributes(items[i]);
+ for(var j=0; j < attributes.length; j++){
+ console.debug("attribute: [" + attributes[j] + "] have value: " + table.getValue(items[i], attributes[j]));
+ }
+ }
+
+ }
+ table.fetch({query:{X:1}, onComplete: testComplete});
+ table.fetch({query:{X:2}, onComplete: testComplete});
+ table.fetch({query:{X:3}, onComplete: testComplete});
+ table.fetch({query:{X:4}, onComplete: testComplete});
+ table.fetch({query:{X:5}, onComplete: testComplete}); // Should be empty
+ }
+ dojo.addOnLoad(init);
+</script>
+
+</head>
+<body class="tundra">
+ <h1>Dojox HtmlDataStore Widget</h1>
+ <hr/>
+ <br/>
+ <br/>
+
+ <!-- Instantiate the HtmlTableStore and bind it to global name tableStore -->
+ <div dojoType="dojox.data.HtmlTableStore" tableId="tableExample" jsId="tableStore"></div>
+
+ <!-- The table to link into with the HtmlTableStore-->
+ <table id="tableExample">
+ <thead>
+ <tr>
+ <th>X</th>
+ <th>Y</th>
+ <th>A</th>
+ <th>B</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr id="test">
+ <td>2</td>
+ <td>3</td>
+ <td></td>
+ <td>8</td>
+ </tr>
+ <tr>
+ <td>1</td>
+ <td>3</td>
+ <td>5</td>
+ <td>7</td>
+ </tr>
+ <tr>
+ <td>4</td>
+ <td>9</td>
+ <td>22</td>
+ <td>777</td>
+ </tr>
+ <tr>
+ <td>3231</td>
+ <td>3</td>
+ <td>535</td>
+ <td>747</td>
+ </tr>
+
+ </tbody>
+ </table>
+
+ <br/>
+ <br/>
+ <blockquote>
+ <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>
+ <div dojoType="dijit.Tree" id="tree" store="tableStore" query="{Y:3}" label="Test tree"></div>
+ </blockquote>
+</body>
+</html>