First of all, Sencha.IO Sync provides the functionality you are looking for. It is still in beta, but it will probably do exactly what you need and you wonβt need to host the database yourself: http://www.sencha.com/products/io
For me, I created applications that use the localstorage proxy for local data storage. It is super easy. Here are some examples of using a data warehouse:
Later in the application, I have an AJAX call that will take all this local data and send it to the server to generate some reports.
Once you set up your stores and models correctly, it's easy to get data back from them. For example, I have a contact repository that has only one entry:
var myContactInfo = contactInfo.first().data;
I have another store called settings, which contains many entries. I can easily get them like this (although there may be a better way):
var settingsArr = [] settings.each(function() { settingsArr.push(this.data); });
Then I can easily send this to the server like this:
var data = {settings: settingsArr, contactInfo: myContactInfo}; Ext.Ajax.request({ url: 'save.php', params: {json: Ext.encode(data)}, success: function(response, opts) {
As with all cases, a good example of examples and APIs should help you, once you find out the basics: http://dev.sencha.com/deploy/touch/docs/?class=Ext.data.Store
source share