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

  • Whenever you search in PBworks or on the Web, Dokkio Sidebar (from the makers of PBworks) will run the same search in your Drive, Dropbox, OneDrive, Gmail, Slack, and browsed web pages. Now you can find what you're looking for wherever it lives. Try Dokkio Sidebar for free.


DataStore-DataSource Pushing Data

Page history last edited by Charles Jolley 13 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.