Opened 10 years ago
Closed 8 years ago
#11733 closed defect (wontfix)
receiving onSet notification on __isDirty attribute when reverting a JsonRestStore
Reported by: | goriol | Owned by: | Kris Zyp |
---|---|---|---|
Priority: | high | Milestone: | tbd |
Component: | DojoX Data | Version: | 1.5 |
Keywords: | Cc: | [email protected]… | |
Blocked By: | Blocking: |
Description
I was testing testing the revert() method of a JsonRestStore? when I encountered a weird behaviour.
First, I connect a handler to the "onSet" notification of a JsonRestStore?:
dojo.connect(this.store, 'onSet', this, function (item, attribute, oldValue, newValue) { console.log('store.onSet event triggered on attribute '+attribute); } );
Then, I change "prop1" of oldItem with the following code (no "onSet" event triggered this way):
_this.store.changing(oldItem); for (prop in newItem) { if ((newItem.hasOwnProperty(prop)) && (prop !== idAttribute) && (oldItem[prop] !== newItem[prop])) { oldItem[prop] = newItem[prop]; } } _this.store.save({});
If the server answers with a error status (say 500), the store will revert its state and this will trigger an "onSet" notification on the unsaved attribute "prop1".
But I also receive an "onSet" notification for the "isDirty" attribute. I do not consider this as normal behavior.
Change History (3)
comment:1 Changed 10 years ago by
Component: | General → DojoX Data |
---|---|
Owner: | changed from anonymous to Jared Jurkiewicz |
comment:2 Changed 10 years ago by
Owner: | changed from Jared Jurkiewicz to Kris Zyp |
---|
comment:3 Changed 8 years ago by
Resolution: | → wontfix |
---|---|
Status: | new → closed |
Note: See
TracTickets for help on using
tickets.
dojox/data is abandoned. Some dojox/data stores have been upgraded to use the Dojo Store API and can be found at https://github.com/kfranqueiro/dojo-smore.