Ticket #7841 (new defect)
JsonRestStore deleteItem deletes nothing in store
| Reported by: | syq | Owned by: | kzyp |
|---|---|---|---|
| Priority: | normal | Milestone: | tbd |
| Component: | Data | Version: | 1.2.0 |
| Severity: | major | Keywords: | JsonRestStore |
| Cc: |
Description
I use dijit.Tree with JsonRestStore?. After do store.deleteItem(old_item), and then save, the old_item is gone from tree and server database. Then I do store.newItem(new_item), both new_item and old_item appear. I check the store._index and find the old_item is still there. I am not certain if store._index is what causes the problem.
The store.deleteItem(old_item) actually does dojox.rpc.JsonRest?.deleteObject(old_item), which does not update the parent object of the old_item. So when do store.newItem(new_item), the getValues retrieves the children of old_item's parent which still includes the deleted old_item. This results in the deleted item reappearing on tree when adding a new item to the same parent of the deleted item.