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.