I have store (and grid which displays its content), users could remove and add item but unfortunately one item after deleting could not be again added. I figure out problem is same id which was previously in store.
I use Dojo 1.6.
In firebug console I got:
Error: assertion failed in ItemFileWriteStore
Here is demo on jsFiddle: http://jsfiddle.net/MBBnE/
and here 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});
});