I would like to know how ot update the data of the dojo.dijit.tree component dynamically. At the moment I\'m creating the tree using dojo.data.ItemFileReadStore and dijit.tree.F
Layke's solution did not work for me. I am using dojo 1.9.1. My store is of type "ItemFileWriteStore" and the model of type "TreeStoreModel".
myStore = new ItemFileWriteStore({
url : "../jaxrs/group/tree"
});
itemModel = new TreeStoreModel({
store : myStore,
query : {
id : "0"
}
});
parser.parse();
This works for me:
var tree = dijit.byId('myTree');
tree.dndController.selectNone();
tree._itemNodesMap = {};
tree.model.root = null;
tree.model.store.clearOnClose = true;
tree.model.store.urlPreventCache = true;
tree.model.store.revert();
tree.model.store.close();
tree.rootNode.state = "UNCHECKED";
if (tree.rootNode) {
tree.rootNode.destroyRecursive();
}
tree.postMixInProperties();
tree._load();