Changeset 10580
- Timestamp:
- 09/20/07 22:56:56 (22 months ago)
- Files:
-
- 13 modified
-
dijit/trunk/demos/i18n.html (modified) (2 diffs)
-
dijit/trunk/demos/mail.html (modified) (2 diffs)
-
dijit/trunk/demos/mail/mail.json (modified) (1 diff)
-
dijit/trunk/tests/test_Tree.html (modified) (2 diffs)
-
dijit/trunk/tests/test_Tree_Notification_API_Support.html (modified) (6 diffs)
-
dijit/trunk/tests/tree/test_Tree_DnD.html (modified) (8 diffs)
-
dijit/trunk/themes/themeTester.html (modified) (1 diff)
-
dijit/trunk/themes/tundra/tundra.css (modified) (1 diff)
-
dijit/trunk/Tree.js (modified) (10 diffs)
-
dijit/trunk/_tree/Tree.html (modified) (1 diff)
-
dojox/trunk/data/demos/demo_LazyLoad.html (modified) (1 diff)
-
dojox/trunk/data/demos/demo_MultiStores.html (modified) (3 diffs)
-
dojox/trunk/data/tests/ml/test_HtmlTableStore_declaratively.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
dijit/trunk/demos/i18n.html
r10465 r10580 68 68 <tr> 69 69 <td width="30%" style="vertical-align: top;"> 70 <div dojoType="dijit.Tree" id="mytree" store="store" >70 <div dojoType="dijit.Tree" id="mytree" store="store" label="Continents"> 71 71 <!-- Override all the data access functions to work from the I18N data store --> 72 72 <script type="dojo/method" event="getItemChildren" args="item, onComplete"> … … 91 91 <script type="dojo/method" event="getIconClass" args="item"> 92 92 var icon = 93 ( store.getValue(item, "type") == "country") ?93 (item && store.getValue(item, "type") == "country") ? 94 94 ("countryIcon country" + store.getValue(item, "iso") + "Icon") : 95 95 null; -
dijit/trunk/demos/mail.html
r10564 r10580 310 310 <div dojoType="dijit.layout.AccordionPane" title="Folders"> 311 311 <div dojoType="dijit.Tree" id="mytree" store="mailStore" 312 labelAttr="label" childrenAttr="folders" query="{type:'folder'}" >312 labelAttr="label" childrenAttr="folders" query="{type:'folder'}" label="Folders"> 313 313 <script type="dojo/method" event="onClick" args="item"> 314 if(!item){ 315 return; // top level node in tree doesn't correspond to any item 316 } 314 317 /* filter the message list to messages in this folder */ 315 318 table.query.query = { … … 320 323 </script> 321 324 <script type="dojo/method" event="getIconClass" args="item"> 322 var specifiedIcon = mailStore.getValue(item, "icon"); 323 return specifiedIcon || "mailIconFolderDocuments"; 325 return (item && mailStore.getValue(item, "icon")) || "mailIconFolderDocuments"; 324 326 </script> 325 327 </div> 326 328 </div> 327 329 <div dojoType="dijit.layout.AccordionPane" title="Address Book"> 328 329 <!-- 330 TODO: want to use a table here but somehow can't have two table instances on the same page. 331 Debug later 332 <span dojoType="demo.Table" store="mailStore" 333 query="{ query: { type: 'address' }, columns: [ {name: 'User name', attribute: 'label'} ], sort: [ { attribute: 'label' } ] }" 334 id="addresses" style="width: 100%"> 335 <script type="dojo/method" event="preamble"> 336 this.query = { type: "address" }; 337 this.columns = [ 338 { 339 name: "Name", 340 attribute: "label" 341 } 342 ]; 343 </script> 344 <script type="dojo/method" event="onClick" args="item"> 345 table.query.query.sender = mailStore.getValue(item, "sender"); 346 delete table.query.query.folder; 347 table.runQuery(); 348 </script> 349 </span> 350 --> 351 <div dojoType="dijit.Tree" id="addrTree" store="mailStore" 352 labelAttr="label" childrenAttr="folders" query="{type:'address'}"> 330 <span dojoType="demo.Table" store="mailStore" 331 query="{ query: { type: 'address' }, columns: [ {name: 'User name', attribute: 'label'} ], sort: [ { attribute: 'label' } ] }" 332 id="addresses" style="width: 100%"> 333 <script type="dojo/method" event="preamble"> 334 this.query = { type: "address" }; 335 this.columns = [ 336 { 337 name: "Name", 338 attribute: "label" 339 } 340 ]; 341 </script> 353 342 <script type="dojo/method" event="onClick" args="item"> 354 /* filter the message list to messages from this user */ 355 table.query.query = { 356 type: "message", 357 sender: mailStore.getValue(item, "label") 358 }; 343 table.query.query.sender = mailStore.getValue(item, "sender"); 344 delete table.query.query.folder; 359 345 table.runQuery(); 360 346 </script> 361 <script type="dojo/method" event="getIconClass" args="item"> 362 var specifiedIcon = mailStore.getValue(item, "icon"); 363 return specifiedIcon || "mailIconFolderDocuments"; 364 </script> 365 </div> 347 </span> 366 348 </div> 367 349 </div> <!-- end of Accordion --> -
dijit/trunk/demos/mail/mail.json
r10319 r10580 5 5 6 6 // Hierarchy of folders 7 { type: 'folder', id: 'mailbox', label:'Folders', folders: [ 8 { type: 'folder', id: 'inbox', label:'Inbox', icon:'mailIconFolderInbox' }, 9 { type: 'folder', id: 'deleted', label:'Trash', icon:'mailIconTrashcanFull' }, 10 { type: 'folder', id: 'save', label:'Save', folders:[ 11 { id: 'work', label:'stuff for work'}, 12 { id: 'fun', label:'stuff for fun'} 13 ]} 7 { type: 'folder', id: 'inbox', label:'Inbox', icon:'mailIconFolderInbox' }, 8 { type: 'folder', id: 'deleted', label:'Trash', icon:'mailIconTrashcanFull' }, 9 { type: 'folder', id: 'save', label:'Save', folders:[ 10 { id: 'work', label:'stuff for work'}, 11 { id: 'fun', label:'stuff for fun'} 14 12 ]}, 15 13 -
dijit/trunk/tests/test_Tree.html
r10506 r10580 32 32 33 33 <div dojoType="dijit.Tree" id="mytree" store="continentStore" query="{type:'continent'}" 34 labelAttr="name" >34 labelAttr="name" label="Continents"> 35 35 <script type="dojo/method" event="onClick" args="item"> 36 36 alert("Execute of node " + continentStore.getLabel(item) … … 80 80 81 81 <div dojoType="dijit.Tree" id="tree2" store="continentStore" query="{type:'continent'}" 82 labelAttr="name" >82 labelAttr="name" label="Continents"> 83 83 <script type="dojo/connect"> 84 84 var menu = dijit.byId("tree_menu"); -
dijit/trunk/tests/test_Tree_Notification_API_Support.html
r10409 r10580 22 22 dojo.require("dojo.parser"); // scan page for widgets and instantiate them 23 23 24 function delete Node(){24 function deleteItem(){ 25 25 var store = dijit.byId("myTree").store; 26 store.deleteItem(selected Node);26 store.deleteItem(selectedItem); 27 27 resetForms(); 28 28 } 29 29 30 function add NodeToStore(){30 function addItem(){ 31 31 var store = dijit.byId("myTree").store; 32 if(selectedNode!=null){ 33 var pInfo = {parent: selectedNode, attribute:"children"}; 34 store.newItem({id: dojo.byId('newId').value,name:dojo.byId("label").value,someProperty:dojo.byId("someProperty")},pInfo); 35 }else{ 36 store.newItem({id: dojo.byId('newId').value,name:dojo.byId("label").value,someProperty:dojo.byId("someProperty")}); 37 } 32 var pInfo = selectedItem ? {parent: selectedItem, attribute:"children"} : null; 33 console.debug(pInfo); 34 store.newItem({id: dojo.byId('newId').value,name:dojo.byId("label").value,someProperty:dojo.byId("someProperty")},pInfo); 38 35 resetForms(); 39 36 } … … 41 38 function resetForms() { 42 39 dojo.byId('selected').innerHTML="Tree Root" 43 selected Node=null;40 selectedItem=null; 44 41 dojo.byId("uLabel").value = ""; 45 42 dojo.byId("uSomeProperty").value = ""; … … 50 47 var store = dijit.byId("myTree").store; 51 48 52 if (selected Node!=null){53 if (dojo.byId("uLabel").value != store.getValue(selected Node, "name")){54 store.setValue(selected Node, "name", dojo.byId("uLabel").value);49 if (selectedItem!=null){ 50 if (dojo.byId("uLabel").value != store.getValue(selectedItem, "name")){ 51 store.setValue(selectedItem, "name", dojo.byId("uLabel").value); 55 52 } 56 53 57 if (dojo.byId("uSomeProperty").value != store.getValue(selected Node, "someProperty")){58 store.setValue(selected Node, "someProperty", dojo.byId("uSomeProperty").value);54 if (dojo.byId("uSomeProperty").value != store.getValue(selectedItem, "someProperty")){ 55 store.setValue(selectedItem, "someProperty", dojo.byId("uSomeProperty").value); 59 56 } 60 57 61 58 }else{ 62 console.error("Can t update the tree root");59 console.error("Can't update the tree root"); 63 60 } 64 61 } … … 66 63 dojo.addOnLoad(function(){ 67 64 resetForms(); 68 dojo.subscribe("myTree", null, function(message){69 if(message.event=="execute"){70 selectedNode = message.item;71 dojo.byId('selected').innerHTML=treeTestStore.getLabel(message.item);72 dojo.byId('uLabel').value = treeTestStore.getLabel(message.item);73 dojo.byId('uSomeProperty').value = treeTestStore.getValue(message.item,"someProperty");74 }75 });76 65 }); 77 66 67 function onClick(item){ 68 selectedItem = item; 69 dojo.byId('selected').innerHTML= item ? treeTestStore.getLabel(item) : ""; 70 dojo.byId('uLabel').value = item ? treeTestStore.getLabel(item) : ""; 71 dojo.byId('uSomeProperty').value = item ? treeTestStore.getValue(item,"someProperty") : ""; 72 } 78 73 </script> 79 74 … … 86 81 url="../tests/treeTest.json"></div> 87 82 88 <div dojoType="dijit.Tree" id="myTree" store="treeTestStore"labelAttr="name" somePropertyAttr="someProperty"></div>83 <div dojoType="dijit.Tree" id="myTree" label="root" store="treeTestStore" onClick="onClick" labelAttr="name" somePropertyAttr="someProperty"></div> 89 84 90 85 <br /> … … 102 97 Description: <input id="someProperty" width="50" value="Enter Some Property Value" /><br /><br /> 103 98 104 <div dojoType="dijit.form.Button" iconClass="noteIcon" onClick="add NodeToStore();">Add Item to Store</div>99 <div dojoType="dijit.form.Button" iconClass="noteIcon" onClick="addItem();">Add Item to Store</div> 105 100 <br /> 106 <button dojoType="dijit.form.Button" iconClass="noteIcon" onClick="delete Node()">Delete Node (and children)</button>101 <button dojoType="dijit.form.Button" iconClass="noteIcon" onClick="deleteItem()">Delete Node (and children)</button> 107 102 108 103 -
dijit/trunk/tests/tree/test_Tree_DnD.html
r10488 r10580 11 11 @import "../css/dijitTests.css"; 12 12 @import "../dndDefault.css"; 13 14 @import "../../../dojo/resources/dojo.css"; 15 @import "../../../dojo/resources/dnd.css"; 16 @import "../../../dojo/tests/dnd/dndDefault.css"; 17 18 19 20 13 @import "../../../dojo/resources/dojo.css"; 14 @import "../../../dojo/resources/dnd.css"; 15 @import "../../../dojo/tests/dnd/dndDefault.css"; 21 16 </style> 22 17 … … 40 35 41 36 globalId=1000; 37 lastSelected=null; 42 38 43 39 dojo.addOnLoad(function(){ … … 64 60 parent: lastSelected, 65 61 attribute: "children" 66 } 62 }; 67 63 68 64 //store.newItem({name: dojo.byId('newCat').value, id:globalId++, numberOfItems:dojo.byId('numItems').value}, pInfo); … … 118 114 function tree2CheckItemAcceptance(node,source) { 119 115 var item = this.tree._domElement2TreeNode(node).item; 120 if ( this.tree.store.hasAttribute(item,"numberOfItems")){116 if (item && this.tree.store.hasAttribute(item,"numberOfItems")){ 121 117 var numItems=this.tree.store.getValues(item, "numberOfItems"); 122 118 return true; … … 145 141 146 142 function getIcon(item) { 147 if ( catStore.hasAttribute(item, "numberOfItems")) {143 if (!item || catStore.hasAttribute(item, "numberOfItems")) { 148 144 console.log("returning folder class"); 149 145 return "myFolder"; … … 152 148 return "myItem" 153 149 } 154 155 150 </script> 156 151 … … 178 173 <div dojoType="dojo.data.ItemFileWriteStore" jsId="catStore" 179 174 url="categories.json"></div> 180 181 182 183 175 184 176 <table width="100%" style="margin:5px solid gray" > … … 218 210 <h2>Collection Count Summary</h2> 219 211 <p>You can't drop items onto this tree.</p> 220 <div class="container" dojoType="dijit.Tree" id="myTree" store="catStore" labelAttr="name" getLabel="tree1CustomLabel" childrenAttr="children" dndController="dijit._tree.dndSource" checkAcceptance="dndAccept" getIconClass="getIcon"></div> 212 <div class="container" dojoType="dijit.Tree" id="myTree" store="catStore" label="Collections" 213 labelAttr="name" getLabel="tree1CustomLabel" childrenAttr="children" dndController="dijit._tree.dndSource" 214 checkAcceptance="dndAccept" getIconClass="getIcon"></div> 221 215 </td> 222 216 <td> 223 217 <h2>Collection</h2> 224 218 <p>Drop items onto this tree, but only on categories, should fail to let you drop on other items.</p> 225 <div class="container" dojoType="dijit.Tree" id="myTree2" store="catStore" labelAttr="name" childrenAttr="children, items" dndController="dijit._tree.dndSource" onDndDrop="tree2CustomDrop" checkAcceptance="dndAccept" checkItemAcceptance="tree2CheckItemAcceptance" getIconClass="getIcon"></div>219 <div class="container" dojoType="dijit.Tree" id="myTree2" label="Collections" store="catStore" labelAttr="name" childrenAttr="children, items" dndController="dijit._tree.dndSource" onDndDrop="tree2CustomDrop" checkAcceptance="dndAccept" checkItemAcceptance="tree2CheckItemAcceptance" getIconClass="getIcon"></div> 226 220 </td> 227 221 </tr> 228 222 </table> 229 223 230 231 224 </body> 232 225 </html> -
dijit/trunk/themes/themeTester.html
r10495 r10580 292 292 <!-- tree widget --> 293 293 <div dojoType="dijit.Tree" store="continentStore" query="{type:'continent'}" 294 labelAttr="name" typeAttr="type" >294 labelAttr="name" typeAttr="type" label="Continents"> 295 295 </div> 296 296 </div> -
dijit/trunk/themes/tundra/tundra.css
r10509 r10580 891 891 zoom: 1; /* MOW: what the heck is this doing in here? */ 892 892 } 893 .tundra .dijitTreeIsRoot {894 margin-left: 0;895 }896 893 897 894 /* left vertical line (grid) for all nodes */ 898 895 .tundra .dijitTreeIsLast { 899 896 background: url('images/i_half.gif') no-repeat; 897 } 898 899 .tundra .dijitTreeIsRoot { 900 margin-left: 0; 901 background: none; 900 902 } 901 903 -
dijit/trunk/Tree.js
r10569 r10580 8 8 9 9 dojo.declare( 10 "dijit._Tree Base",10 "dijit._TreeNode", 11 11 [dijit._Widget, dijit._Templated, dijit._Container, dijit._Contained], 12 12 { 13 // summary: 14 // Base class for Tree and _TreeNode 13 // summary 14 // Single node within a tree 15 16 // item: dojo.data.Item 17 // the dojo.data entry this tree represents 18 item: null, 19 20 isTreeNode: true, 21 22 // label: String 23 // Text of this tree node 24 label: "", 25 26 isExpandable: null, // show expando node 27 28 isExpanded: false, 15 29 16 30 // state: String … … 19 33 // then after dojo.data query it becomes "LOADING" and, finally "LOADED" 20 34 state: "UNCHECKED", 21 locked: false, 22 startExpanded: true, 23 24 lock: function(){ 25 // summary: lock this node (and it's descendants) while a delete is taking place? 26 this.locked = true; 27 }, 28 unlock: function(){ 29 if(!this.locked){ 30 //dojo.debug((new Error()).stack); 31 throw new Error(this.declaredClass+" unlock: not locked"); 32 } 33 this.locked = false; 34 }, 35 36 isLocked: function(){ 37 // summary: can this node be modified? 38 // returns: false if this node or any of it's ancestors are locked 39 var node = this; 40 while(true){ 41 if(node.lockLevel){ 42 return true; 43 } 44 if(!node.getParent() || node.isTree){ 45 break; 46 } 47 node = node.getParent(); 48 } 49 return false; 50 }, 51 35 36 templatePath: dojo.moduleUrl("dijit", "_tree/Node.html"), 37 38 postCreate: function(){ 39 // set label, escaping special characters 40 this.setLabelNode(this.label); 41 42 // set expand icon for leaf 43 this._setExpando(); 44 45 // set icon based on item 46 dojo.addClass(this.iconNode, this.tree.getIconClass(this.item)); 47 48 if(this.isExpandable){ 49 dijit.wai.setAttr(this.labelNode, "waiState", "expanded", this.isExpanded); 50 } 51 }, 52 53 markProcessing: function(){ 54 // summary: visually denote that tree is loading data, etc. 55 this.state = "LOADING"; 56 this._setExpando(true); 57 }, 58 59 unmarkProcessing: function(){ 60 // summary: clear markup from markProcessing() call 61 this._setExpando(false); 62 }, 63 64 _updateLayout: function(){ 65 // summary: set appropriate CSS classes for this.domNode 66 dojo.toggleClass(this.domNode, "dijitTreeIsLast", !this.getNextSibling()); 67 }, 68 69 _setExpando: function(/*Boolean*/ processing){ 70 // summary: set the right image for the expando node 71 72 // apply the appropriate class to the expando node 73 var styles = ["dijitTreeExpandoLoading", "dijitTreeExpandoOpened", 74 "dijitTreeExpandoClosed", "dijitTreeExpandoLeaf"]; 75 var idx = processing ? 0 : (this.isExpandable ? (this.isExpanded ? 1 : 2) : 3); 76 dojo.forEach(styles, 77 function(s){ 78 dojo.removeClass(this.expandoNode, s); 79 }, this 80 ); 81 dojo.addClass(this.expandoNode, styles[idx]); 82 83 // provide a non-image based indicator for images-off mode 84 this.expandoNodeText.innerHTML = 85 processing ? "*" : 86 (this.isExpandable ? 87 (this.isExpanded ? "-" : "+") : "*"); 88 }, 89 90 expand: function(){ 91 // summary: show my children 92 if(this.isExpanded){ return; } 93 // cancel in progress collapse operation 94 if(this._wipeOut.status() == "playing"){ 95 this._wipeOut.stop(); 96 } 97 98 this.isExpanded = true; 99 dijit.wai.setAttr(this.labelNode, "waiState", "expanded", "true"); 100 dijit.wai.setAttr(this.containerNode, "waiRole", "role", "group"); 101 102 this._setExpando(); 103 104 this._wipeIn.play(); 105 }, 106 107 collapse: function(){ 108 if(!this.isExpanded){ return; } 109 110 // cancel in progress expand operation 111 if(this._wipeIn.status() == "playing"){ 112 this._wipeIn.stop(); 113 } 114 115 this.isExpanded = false; 116 dijit.wai.setAttr(this.labelNode, "waiState", "expanded", "false"); 117 this._setExpando(); 118 119 this._wipeOut.play(); 120 }, 121 122 setLabelNode: function(label){ 123 this.labelNode.innerHTML=""; 124 this.labelNode.appendChild(document.createTextNode(label)); 125 }, 52 126 53 127 _setChildren: function(/* Object[] */ childrenArray){ … … 88 162 } 89 163 90 if(this.isTree){91 // put first child in tab index if one exists.92 var fc = this.getChildren()[0];93 var tabnode = fc ? fc.labelNode : this.domNode;94 tabnode.setAttribute("tabIndex", "0");95 }96 97 164 if(this._setExpando){ 98 165 // change expando to/form dot or + icon, as appropriate … … 100 167 } 101 168 102 if (this.isTree && this.startExpanded) { 103 var children = this.getChildren(); 104 for(var i=0; i<children.length;i++){ 105 if (children[i].isExpandable){ 106 this._expandNode(children[i]); 107 } 108 } 169 // create animations for showing/hiding the children (if children exist) 170 if(this.containerNode && !this._wipeIn){ 171 this._wipeIn = dojo.fx.wipeIn({node: this.containerNode, duration: 150}); 172 this._wipeOut = dojo.fx.wipeOut({node: this.containerNode, duration: 150}); 109 173 } 110 174 … … 158 222 dojo.declare( 159 223 "dijit.Tree", 160 dijit._Tree Base,224 dijit._TreeNode, 161 225 { 162 226 // store: String||dojo.data.Store … … 174 238 templatePath: dojo.moduleUrl("dijit", "_tree/Tree.html"), 175 239 176 isExpand ed: true, // consider this "root node" to be always expanded240 isExpandable: true, 177 241 178 242 isTree: true, … … 200 264 postMixInProperties: function(){ 201 265 this.tree = this; 266 this.lastFocused = this.labelNode; 202 267 203 268 this._itemNodeMap={}; … … 212 277 213 278 postCreate: function(){ 214 this.containerNode = this.domNode;215 216 279 // make template for container node (we will clone this and insert it into 217 280 // any nodes that have children) … … 222 285 this.containerNodeTemplate = div; 223 286 287 this.inherited("postCreate", arguments); 288 224 289 // load top level children 225 this. getItemChildren(null, dojo.hitch(this, "_onLoadAllItems", this));290 this._expandNode(this); 226 291 227 292 if (this.dndController){ … … 764 829 } 765 830 }); 766 767 dojo.declare(768 "dijit._TreeNode",769 dijit._TreeBase,770 {771 // summary772 // Single node within a tree773 774 templatePath: dojo.moduleUrl("dijit", "_tree/Node.html"),775 776 // item: dojo.data.Item777 // the dojo.data entry this tree represents778 item: null,779 780 isTreeNode: true,781 782 // label: String783 // Text of this tree node784 label: "",785 786 isExpandable: null, // show expando node787 788 isExpanded: false,789 790 postCreate: function(){791 // set label, escaping special characters792 this.labelNode.innerHTML = "";793 this.labelNode.appendChild(document.createTextNode(this.label));794 795 // set expand icon for leaf796 this._setExpando();797 798 // set icon based on item799 dojo.addClass(this.iconNode, this.tree.getIconClass(this.item));800 801 // set icon based on item802 dojo.addClass(this.labelNode, this.tree.getLabelClass(this.item));803 804 805 if(this.isExpandable){806 dijit.wai.setAttr(this.labelNode, "waiState", "expanded", this.isExpanded);807 }808 },809 810 markProcessing: function(){811 // summary: visually denote that tree is loading data, etc.812 this.state = "LOADING";813 this._setExpando(true);814 },815 816 unmarkProcessing: function(){817 // summary: clear markup from markProcessing() call818 this._setExpando(false);819 },820 821 _updateLayout: function(){822 // summary: set appropriate CSS classes for this.domNode823 dojo.toggleClass(this.domNode, "dijitTreeIsRoot", "isTree" in this.getParent());824 dojo.toggleClass(this.domNode, "dijitTreeIsLast", !this.getNextSibling());825 },826 827 _setExpando: function(/*Boolean*/ processing){828 // summary: set the right image for the expando node829 830 // apply the appropriate class to the expando node831 var styles = ["dijitTreeExpandoLoading", "dijitTreeExpandoOpened",832 "dijitTreeExpandoClosed", "dijitTreeExpandoLeaf"];833 var idx = processing ? 0 : (this.isExpandable ? (this.isExpanded ? 1 : 2) : 3);834 dojo.forEach(styles,835 function(s){836 dojo.removeClass(this.expandoNode, s);837 }, this838 );839 dojo.addClass(this.expandoNode, styles[idx]);840 841 // provide a non-image based indicator for images-off mode842 this.expandoNodeText.innerHTML =843 processing ? "*" :844 (this.isExpandable ?845 (this.isExpanded ? "-" : "+") : "*");846 },847 848 _setChildren: function(items){849 var ret = this.inherited('_setChildren', arguments);850 851 // create animations for showing/hiding the children (if children exist)852 if(this.containerNode && !this._wipeIn){853 this._wipeIn = dojo.fx.wipeIn({node: this.containerNode, duration: 150});854 this._wipeOut = dojo.fx.wipeOut({node: this.containerNode, duration: 150});855 }856 857 return ret;858 },859 860 expand: function(){861 // summary: show my children862 if(this.isExpanded){ return; }863 // cancel in progress collapse operation864 if(this._wipeOut.status() == "playing"){865 this._wipeOut.stop();866 }867 868 this.isExpanded = true;869 dijit.wai.setAttr(this.labelNode, "waiState", "expanded", "true");870 dijit.wai.setAttr(this.containerNode, "waiRole", "role", "group");871 872 this._setExpando();873 874 this._wipeIn.play();875 },876 877 collapse: function(){878 if(!this.isExpanded){ return; }879 880 // cancel in progress expand operation881 if(this._wipeIn.status() == "playing"){882 this._wipeIn.stop();883 }884 885 this.isExpanded = false;886 dijit.wai.setAttr(this.labelNode, "waiState", "expanded", "false");887 this._setExpando();888 889 this._wipeOut.play();890 },891 892 setLabelNode: function(label){893 this.labelNode.innerHTML="";894 this.labelNode.appendChild(document.createTextNode(label));895 }896 }); -
dijit/trunk/_tree/Tree.html
r9963 r10580 1 1 <div class="dijitTreeContainer" style="" waiRole="tree" 2 dojoAttachEvent="onclick:_onClick,onkeypress:_onKeyPress" 3 ></div> 2 dojoAttachEvent="onclick:_onClick,onkeypress:_onKeyPress"> 3 <div class="dijitTreeNode dijitTreeIsRoot dijitTreeExpandLeaf dijitTreeChildrenNo" waiRole="presentation" 4 ><span dojoAttachPoint="expandoNode" class="dijitTreeExpando" waiRole="presentation" 5 ></span 6 ><span dojoAttachPoint="expandoNodeText" class="dijitExpandoText" waiRole="presentation" 7 ></span 8 > 9 <div dojoAttachPoint="contentNode" class="dijitTreeContent" waiRole="presentation"> 10 <div dojoAttachPoint="iconNode" class="dijitInline dijitTreeIcon" waiRole="presentation"></div> 11 <span dojoAttachPoint=labelNode class="dijitTreeLabel" wairole="treeitem" tabindex="0"></span> 12 </div> 13 </div> 14 </div> -
dojox/trunk/data/demos/demo_LazyLoad.html
r9497 r10580 59 59 --> 60 60 <b>Continents</b> 61 <div dojoType="dijit.Tree" id=tree store="continentStore" query="{type:'continent'}"61 <div dojoType="dijit.Tree" id=tree label="Continents" store="continentStore" query="{type:'continent'}" 62 62 labelAttr="name" typeAttr="type"></div> 63 63 </blockquote> -
dojox/trunk/data/demos/demo_MultiStores.html
r9942 r10580 39 39 40 40 <!-- 41 The store instance wused by this demo.41 The store instances used by this demo. 42 42 --> 43 43 <div dojoType="dojo.data.ItemFileReadStore" url="geography.json" jsId="ifrGeoStore"></div> … … 54 54 55 55 <b>Tree:</b><br> 56 <div dojoType="dijit.Tree" id="tree1" store="opmlGeoStore"></div>56 <div dojoType="dijit.Tree" id="tree1" label="Continents" store="opmlGeoStore"></div> 57 57 </blockquote> 58 58 … … 67 67 68 68 <b>Tree:</b><br> 69 <div dojoType="dijit.Tree" id="tree2" store="ifrGeoStore"></div>69 <div dojoType="dijit.Tree" id="tree2" label="Continents" store="ifrGeoStore"></div> 70 70 </blockquote> 71 71 </body> -
dojox/trunk/data/tests/ml/test_HtmlTableStore_declaratively.html
r9424 r10580 115 115 <blockquote> 116 116 <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> 117 <div dojoType="dijit.Tree" id="tree" store="tableStore" query="{Y:3}" ></div>117 <div dojoType="dijit.Tree" id="tree" store="tableStore" query="{Y:3}" label="Test tree"></div> 118 118 </blockquote> 119 119 </body>