How can I make the store observable for the ItemFileWriteStore function below?Am I using the correct syntax below? It isn't working in my code, please suggest.
store = new dojo.store.Observable(dojo.data.ItemFileWriteStore{
target:'store'
url: "my url"
}
I have written a small function in my dojo tree code as below to add new child folder under the parent folder of the tree structure created but it is not getting saved finally in the store. It is opening till the prompt "Folder name", after that when I add the folder name and click on ok, it is not saving in the folder tree structure. can someone suggest where it is going wrong?
Here is my code to create new folder which isnt working:
function myFunction(item){
item.name = prompt("Folder name");
var childItem = {
name: "New Folder",
id: Math.random(),
parent: item.id
};
store.put(childItem, {overwrite: true
});
store.put(item);
}