Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I assume that you followed the <a href="http://dojotoolkit.org/2008/02/12/dijit-tree-and-dojo-data-dojo-1-1" rel="nofollow noreferrer">dijit.Tree and dojo.data in Dojo 1.1</a> tutorial which directed you to pass the data to the tree control using a data store. That had me banging my head of a brick wall for a while. </p> <p>Its not really a great approach and the alternative is not really well documented. You need to create a use model instead. I have included an example below of a tree model that I created for displaying the structure of an LDAP directory.</p> <p>You will find the default implementation of the model in your dojo distribution at ./dijit/_tree/model.js. The comments should help you understand the functions supported by the model.</p> <p>The IDirectoryService class the code below are stubs for server-side Java POJOs generated by <a href="http://directwebremoting.org" rel="nofollow noreferrer">Direct Web Remoting</a> (DWR). I highly recommend DWR if you going to be doing a lot of client-server interaction.</p> <pre> dojo.declare("LDAPDirectoryTreeModel", [ dijit.tree.model ], { getRoot : function(onItem) { IDirectoryService.getRoots( function(roots) { onItem(roots[0]) }); }, mayHaveChildren : function(item) { return true; }, getChildren : function(parentItem, onComplete) { IDirectoryService.getChildrenImpl(parentItem, onComplete); }, getIdentity : function(item) { return item.dn; }, getLabel : function(item) { return item.rdn; } }); </pre> <p>And here is an extract from the my JSP page where I created the model and used it to populate the tree control.</p> <pre> &lt;div dojoType="LDAPDirectoryTreeModel" jsid="treeModel" id="treeModel"&gt; &lt;/div&gt; &lt;div jsid="tree" id="tree" dojoType="dijit.Tree" model="treeModel" labelAttr="name" label="${directory.host}:${directory.port}"&gt; &lt;/div&gt; </pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload