Login Register

tree

Tree - how to toggle tree node icon between checked checkbox and unchecked checkbox

I have a tree for which I need to be able to toggle the icons on the nodes between a checked checkbox and unchecked checkbox. I can use getIconClass to set the initial icon for all of the nodes to an unchecked checkbox (per example provided on pp. 329-335 in Mastering Dojo by Rawld Gill, Craig Riecke, and Alex Russel). What I haven't figured out is how to test for which icon is currently set on a tree node so that when the node is clicked the icon can be toggled to its inverse. If anyone has done this, I would appreciate seeing your example.

Bind a Tree to a servlet

I have been trying to bind a tree to a servlet but have not been able to find an example of how to do this properly. Basically, I have seen the tree demo pages that use static content, but what I want to do is to load the tree from a source that is a server request (http response returns xml, text, or json). Of course I'll want to send changes back to the server as well, but to begin I just want to load the tree from a servlet source.

Constructing Tree using content from xml file

Hi All,

I'm new to Dojo and JS and I'm looking to represent an XML file using the tree widget. I have seen some posts on this but not getting anything. can any one give me working example for the above scene.

Thanks.

How do I know when a tree has finished loading?

I want to highlight (select) the tree node that corresponds to a model object. It looks like I can use the tree's _itemNodeMap to find the node that corresponds to my object, and then I can call focusNode to select it. However, _itemNodeMap isn't fully populated until the tree is finished loading, and I haven't found a callback that lets me know when that's happened. Could some kind person point me in the right direction?

Programmatically reloading tree made by using ForestStoreModel

Need to update/refresh tree widget after its created with new JSON data. The tree widget is created using ForestStoreModel. Here is the code, as seen in - dijit/test/tree/test_Tree_Programmatic.html


renderTree: function(response){
if(!response) response = this.data;
if( this.tree ){
this.tree.destroy();
this.model.destroy();
this.st = null;
}

this.st = new dojo.data.ItemFileReadStore( { data: response } );

this.model = new dijit.tree.ForestStoreModel( {
store: this.st,
query: {type:'continent'},
rootId: "earth",

Seeking advice on lazy load pattern for custom data store

Hi all,

I've rolled by own custom data store based on the following demo:

http://archive.dojotoolkit.org/dojo-2008-02-19/dojotoolkit/dojox/data/de...

[SOLVED] Is there a way to explicitly tell the tree not to expand all subnodes?

Hi,
I'm using a dijit Tree widget hooked into a read-only data store, based on the one given here:

http://archive.dojotoolkit.org/nightly/dojotoolkit/dojox/data/demos/demo...

Drag & Drop from dijit.Tree into dojo.dnd.Source (ordered list).

I have been playing around with Dojo's drag and drop functionalities lately to familiarize myself with the toolkit (v1.1.1).

One problem that I haven't been able to get just right is to make dragging items from a tree (copyOnly: true) into a dojo.dnd.Source which is an oredered list.
When I drop one of the tree items into the list, dojo appends a <div> element instead of creating a <li> element.

How to find a tree nodes previous sibling

I am trying to implement increase/decrease indentation functionality for a selected node in a tree. The decrease indentation is reasonably straight forward using the following code (although it does loose its relative position as it is just added to the end of the the list of nodes at the new level which is annoying)

var oldParentNode = currentNode.getParent();
var oldParentItem = oldParentNode.item;
var newParentItem = oldParentNode.getParent().item;
currentModel.pasteItem(currentItem, oldParentItem, newParentItem, false);

Problem with templateString of dijit.tree and TreeNodes

Hi,

right now I'm totally lost with 2 Problems with dijit.Tree and templating.

Problem 1:
I already managed to modify the template String of my dijit.Tree. But how do I modify the template String of the TreeNodes?

right now I got:

<code>
var sitemap=new dijit.Tree({
   id:'sitemap',
   store:sitemapStore,
   query:{top:true},
   templateString:"someHTMLstuff"
  }
   ,dojo.byId("sitemap"));
</code>
but this only modifies the Tree container, not the template of the tree nodes.
I'm looking for something like:

Syndicate content