• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to show icons in Tree using DOJO 0.4

 
Sam Gehouse
Ranch Hand
Posts: 281
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using DOJO 0.4 to create a tree. The tree gets successfully created.

My question:
How can I show the lines that connect the nodes? At present, the tree does not show any connecting line.
2) How can I display the tree in fully expanded form? In other words, when the tree gets displayed, all the child nodes are displayed, instead if being collapsed.

Any help will be appreciated.

Following is my code:


<script type="text/javascript">
var djConfig = { isDebug: false };
</script>

<script type="text/javascript" src="scripts/dojo.js">
/* Load Dojo engine */
</script>

<script type="text/javascript">
dojo.require("dojo.lang.common");
dojo.require("dojo.widget.Tree");
dojo.require("dojo.widget.TreeNode");
dojo.require("dojo.widget.TreeContextMenu");
dojo.require("dojo.widget.TreeSelector");
</script>

<script>
dojo.addOnLoad(function() {
dojo.event.topic.subscribe("nodeSelected",
function(message) { alert(message.node.title+" selected"); }
);
});
</script>

<div dojoType="TreeSelector" widgetId="tSelector" eventNames="select:nodeSelected" ></div>

<html>
<div dojoType="Tree" selector="tSelector" toggler="explode">
<div dojoType="TreeNode" title="Item 1">
<div dojoType="TreeNode" title="Item 1.1" ></div>
<div dojoType="TreeNode" title="Item 1.2" >
<div dojoType="TreeNode" title="Item 1.2.1" >
<div dojoType="TreeNode" title="Item 1.2.1.1" ></div>
</div>
<div dojoType="TreeNode" title="Item 1.2.2" ></div>
</div>
<div dojoType="TreeNode" title="Item 1.3" ></div>
</div>
<div dojoType="TreeNode" title="Item 2" ></div>
</div>
</html>
 
Andre Charland
author
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think this question would be better suited to somewhere in www.dojotoolkit.org.

Thanks.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic