PDA

View Full Version : Syncing client store with server data after insert



InSanguis
3 Dec 2011, 2:46 PM
Is there a built-in way to handle passing a newly created primary key back to the client after the server performs an insert and sync it with the appropriate record in the store.

I assume I can create a callback on the store's create but I wanted to check to see if there was built-in functionality for this before I delved into that.

flanders
3 Dec 2011, 5:49 PM
How to encode differs a lot between diferent proxies and readers. But here's an example response when using an json reader with ajax and/or rest



{
success: true,
yourRootProperty: {
idProperty: 'newId',
otherProperty: 'someValue',
}
}


Basically the same thing as with an read. But then only one record and not an array of records

InSanguis
7 Dec 2011, 3:18 PM
Exactly what I needed. Thanks much.