Angelin Nadar
Angelin Nadar

Reputation: 9300

How to commit modified records or update the records in store & commit it to the server?

I have record objects in store as i have mentioned below(structure is of a single record in a store):

data: Object
dirty: true
events: Object
internalId: "ext-record-14"
modified: Object
needsAdd: false
phantom: false
store: Object

Now, we have insert,remove, add methods of store to handle records at store level but I want to update records at store level similar to the updateRecord of FormPanel method.

I want to update all the records which are dirty to the server.

Upvotes: 0

Views: 10112

Answers (1)

T Graff
T Graff

Reputation: 76

Sencha Touch 1.1.1 has a bug that can cause updated records to not be saved. I've worked around the issue by manually setting the isDirty flag on the record to true, and then calling store.sync()

So:

var index = store.find('name','Hello World');
var record = store.getAt(index);
record.set('value', 'new value' );
record.dirty = true;
store.sync();

I'm using the offlinestore proxy.

See Also: http://www.sencha.com/forum/showthread.php?153432-1.1.1-broke-store.sync-for-modified-records/

Upvotes: 6

Related Questions