I have a repository (and a grid displaying its contents), users can delete and add an item, but, unfortunately, one item cannot be added again after deletion. I found out that the problem is the same identifier that was previously in the store.
I am using Dojo 1.6.
In the firebug console, I got:
Error: assertion failed in ItemFileWriteStore
Here is a demo on jsFiddle: http://jsfiddle.net/MBBnE/
and here is the code:
dojo.require("dojo.data.ItemFileWriteStore"); dojo.addOnLoad(function() { var d = { items: [ { id: 23, x: 2}, ], identifier: "id", }; var _store = new dojo.data.ItemFileWriteStore({ data: d, }); var it = null; _store.fetch({ query: { id: "23*" }, onItem: function(i) { it = i; } }) _store.deleteItem(it); console.info(it); _store.newItem({id: 23, x: 3}); });
source share