views:

685

answers:

1

Basically what I have is a tree with 3 nodes, created like so:

        for (var i=0; i<response.length; i++) {
            response[i]["type"] = "project";
        }

        var data = {
            "identifier": "name",
            "label": "name",
            "items": response
        };

        var store = new dojo.data.ItemFileReadStore({data: data});
        console.log(store);

        var treeModel = new dijit.tree.ForestStoreModel({
            store: store,
            query: {
                "type": "project"
            },
            rootId: "root",
            rootLabel: "Projects",
            childrenAttrs: ["project"]
        });

        return new dijit.Tree({
            model: treeModel
        },
        "filetree");

Now what I need to do is, when a user clicks on a node, I will make a call to the server to get some more data, and then add some children to said node. From what I have read, I have to update my data store to update the tree ... but I can't figure this out. Some help is appreciated.

A: 

Scott Johnson: Lazily loading your Dojo Dijit tree widget can improve performance
Hope this article will help :)

Kniganapolke
I ended up finding a much more simple tree component which uses mootools, and ported it to dojo. I think the above solution is the right one to my problem, in the end I think the dijit tree was just overcomplex for my problem.
wildabeast