PDA

View Full Version : Need clarification on JsonStore getModifiedRecords



Elijah
21 Sep 2010, 6:23 AM
getModifiedRecords (http://dev.sencha.com/deploy/dev/docs/source/Store.html#method-Ext.data.Store-getModifiedRecords)() : Ext.data.Record[]
Gets all records modified since the last commit. Modified records are persisted across load operations (e.g., during paging).

How is this done?
Is it keeping a list of just local data thats been manipulated such as changing the value 'Homebound' to 'Homerun'?
What if the user were to change 'Homebound' and then change it back to the original value does the grid realize the value is the same?
Is it comparing the value to the remote data row by row?

I do not understand how it is identifying that data has been modified would someone clearly explain this for me as the API does not do this.
Thank you.

Animal
21 Sep 2010, 6:51 AM
A peek at the code reveals that modifying a field of a Record puts that Record in the "modified" list.

Where it stays until the Store is synced with the server.

Elijah
21 Sep 2010, 7:24 AM
Thanks Animal, but if the value is then changed back to the original value does it remain in that dirty listing?
Since I got you on the line, would you tell me when exactly the item gets listed to the dirty list.
Is it when editing occurs or is it when editing occurs and the user changes out of the field.
Your info is greatly appreciated.

Animal
21 Sep 2010, 7:40 AM
When the set method is called on the Record.

No, it does not detect revert to any "original" value.