• If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • You already know Dokkio is an AI-powered assistant to organize & manage your digital files & messages. Very soon, Dokkio will support Outlook as well as One Drive. Check it out today!

View
 

DataStore-DataSource Pushing Data

Page history last edited by Charles Jolley 14 years, 6 months ago

TODO:  Flush out with details and examples.  Any takers to help?

 

Anytime you receive data from your server that the store did not specifically ask you to retrieve or update, you need to push it in to the store.  Pushing differs from retrieving data in that a record could be in any state when you try to push it; not just BUSY.

 

To push data into the store, use one of pushRetrieve(), pushError(), or pushDestroy().  Pass storeKeys.  pushRetrieve also has you include data hashes.  

 

If you try to push data to a storeKey that can't take your data.  (let's say its been modified in memory and pushing data would override the changes), the method will return NO indicating an error.  You should choose how to resolve it.

 

Calling loadRecords() to load data can be used instead of pushRetrieve() OR dataSourceDidComplete().  loadRecords() inspects the status of each record and calls the proper method. 

 

Moving On 

 

You done with the core programming guide!

Back to DataStore Programming Guide Home ยป

Comments (2)

Maurits Lamers said

at 5:56 am on Jul 23, 2010

I am trying to implement pushing, but it is unclear where to get a reference to the store to be able to call these methods. Should I use SC.Store instead?

Sud said

at 8:25 am on Jul 23, 2010

SC.Store is a prototype, not an object. Try YourAppNameHere.store

You don't have permission to comment on this page.