Cancel Changing method needed in JsonRestStore
Hi to give more control to the developer, a function that allows to cancel an item's dirty stance is necessary. Currently no such method exist. One use case where such a method is necessary is in the case of a tree that support DnD with JsonReststore? as the store.
In the tree's DnD, when we move an item from ParentNodeA to parentNodeB, the moved item is deleted from parentNodeA (1st operation) then moved to ParentNodeB (2nd operation). Both those operations cause a commit at the store level and two trips to the server.
Such an approach is potentially subject to race conditions between the 1st and 2nd operation. To avoid such a race condition, one approach is to simply record the 1st operation in the store widget and only trigger the save on the second operation. To do so however we must be able to cancel the dirty state of the node that was affected in the 1st operation to avoid two commits to the server. Thats where the attached patch comes handy.
Patch file to add CancelChanging? method