diff options
author | mensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f> | 2008-11-14 15:39:19 +0000 |
---|---|---|
committer | mensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f> | 2008-11-14 15:39:19 +0000 |
commit | 1c5685d68f1b73270fb814fe04cbb490eb90ba5f (patch) | |
tree | 3d3ada08a934b96fc31531f1327690d7edc6f766 /includes/js/dojox/data/tests/test_Tree_vs_jsonPathStore.html | |
parent | 104d59099e048688c4dbac37d72137006e396558 (diff) | |
download | semanticscuttle-1c5685d68f1b73270fb814fe04cbb490eb90ba5f.tar.gz semanticscuttle-1c5685d68f1b73270fb814fe04cbb490eb90ba5f.tar.bz2 |
Minor fix: Remove DOJO library (60Mo) replaced by link to Google CDN (online DOJO library)
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@159 b3834d28-1941-0410-a4f8-b48e95affb8f
Diffstat (limited to 'includes/js/dojox/data/tests/test_Tree_vs_jsonPathStore.html')
-rw-r--r-- | includes/js/dojox/data/tests/test_Tree_vs_jsonPathStore.html | 105 |
1 files changed, 0 insertions, 105 deletions
diff --git a/includes/js/dojox/data/tests/test_Tree_vs_jsonPathStore.html b/includes/js/dojox/data/tests/test_Tree_vs_jsonPathStore.html deleted file mode 100644 index f06bafe..0000000 --- a/includes/js/dojox/data/tests/test_Tree_vs_jsonPathStore.html +++ /dev/null @@ -1,105 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" - "http://www.w3.org/TR/html4/strict.dtd"> -<html> -<head> - <title>Dijit Tree Test</title> - - <style someProperty="text/css"> - @import "../../../dojo/resources/dojo.css"; - @import "../../../dijit/tests/css/dijitTests.css"; - </style> - - - <script someProperty="text/javascript" src="../../../dojo/dojo.js" - djConfig="parseOnLoad: true, isDebug: true"></script> - <script someProperty="text/javascript" src="../../../dijit/tests/_testCommon.js"></script> - - <script language="JavaScript" someProperty="text/javascript"> - dojo.require("dojox.data.jsonPathStore"); - dojo.require("dijit.Tree"); - dojo.require("dijit.Menu"); - dojo.require("dijit.form.Button"); - dojo.require("dojo.parser"); // scan page for widgets and instantiate them - - function deleteItem(){ - var store = dijit.byId("myTree").store; - store.deleteItem(selectedItem); - resetForms(); - } - - function addItem(){ - var store = dijit.byId("myTree").store; - var pInfo = selectedItem ? {parent: selectedItem, attribute:"children"} : null; - console.debug(pInfo); - store.newItem({id: dojo.byId('newId').value,name:dojo.byId("label").value,someProperty:dojo.byId("someProperty").value},pInfo); - resetForms(); - } - - function resetForms() { - dojo.byId('selected').innerHTML="Tree Root" - selectedItem=null; - dojo.byId("uLabel").value = ""; - dojo.byId("uSomeProperty").value = ""; - } - - function updateItem(){ - console.log("Updating Item"); - var store = dijit.byId("myTree").store; - - if (selectedItem!=null){ - if (dojo.byId("uLabel").value != store.getValue(selectedItem, "name")){ - store.setValue(selectedItem, "name", dojo.byId("uLabel").value); - } - - if (dojo.byId("uSomeProperty").value != store.getValue(selectedItem, "someProperty")){ - store.setValue(selectedItem, "someProperty", dojo.byId("uSomeProperty").value); - } - - }else{ - console.error("Can't update the tree root"); - } - } - - dojo.addOnLoad(function(){ - resetForms(); - }); - - function onClick(item){ - selectedItem = item; - dojo.byId('selected').innerHTML= item ? treeTestStore.getLabel(item) : ""; - dojo.byId('uLabel').value = item ? treeTestStore.getLabel(item) : ""; - dojo.byId('uSomeProperty').value = item ? treeTestStore.getValue(item,"someProperty") : ""; - } - </script> - -</head> -<body class="tundra"> - - <h1 class="testTitle">Dijit Tree Test - dojo.data.Notification API support</h1> - - <div dojoType="dojox.data.jsonPathStore" jsId="treeTestStore" idAttribute="id" labelAttribute="name" - url="treeTest.json" ></div> - - <div dojoType="dijit.Tree" id="myTree" label="root" store="treeTestStore" onClick="onClick" labelAttr="name" somePropertyAttr="someProperty" query="{query: '$[*]'}"></div> - - <br /> - <h2>Current Selection: <span id='selected'>Tree Root</span> - - <h2>Selected Item:</h2> - Name: <input id="uLabel" width="50" value="Enter Node Label" /><br /> - Description: <input id="uSomeProperty" width="50" value="Some Test Property" /><br /><br /> - <div dojoType="dijit.form.Button" iconClass="noteIcon" onClick="updateItem();">Update Item</div> - - <h2>New Item</h2> - <p>Enter an Id, Name, and optionally a description to be added as a new item to the store. Upon successful addition, the tree will recieve notification of this event and respond accordingly. If you select a node the item will be added to that node, otherwise the item will be added to the tree root. "Id" is the identifer here and as such must be unique for all items in the store.</p> - Id: <input id="newId" width="50" value="Enter Item Id" /><br /> - Name: <input id="label" width="50" value="Enter Item Name" /><br /> - Description: <input id="someProperty" width="50" value="Enter Some Property Value" /><br /><br /> - - <div dojoType="dijit.form.Button" iconClass="noteIcon" onClick="addItem();">Add Item to Store</div> - <br /> - <button dojoType="dijit.form.Button" iconClass="noteIcon" onClick="deleteItem()">Delete Node (and children)</button> - - - </body> -</html> |