-
17 Apr 2012 11:30 AM #1
Unanswered: LocalStorage heeeelp
Unanswered: LocalStorage heeeelp
SALAM all.
im trying to use localStorage for saving data in my mobile app. So i tried a code which i found it in sencha web site.
i create a store file and i put into it
and i create a form and put into itCode:var store =newExt.data.Store({ model:"Search"});
and when i execute it it shows me int the alert as result (Object object).Code:{ xtype: 'button', ui: 'round', text: 'Calculate', handler: function() { var store = new Ext.data.Store({ model: "Search" }); store.add({query: 'Sencha Touch'}); store.add({query: 'Ext JS'}); store.sync(); Ext.Msg.alert("SALAM",store.load()); } },
how can i use the local storage to save data in my app and how can i retreive this data later.
thank youuuuuuuuuuuuu
-
17 Apr 2012 11:33 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,582
- Vote Rating
- 433
- Answers
- 3101
Where do you have your proxy?
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
17 Apr 2012 12:41 PM #3
SALAM.
here is the proxy i put it in model.js file
Code:Ext.regModel('Search',{ fields:['id','query'], proxy:{ type:'localstorage', id :'twitter-Searches'}});
-
18 Apr 2012 4:11 AM #4Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,582
- Vote Rating
- 433
- Answers
- 3101
Why are you alerting store.load()?
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.


Reply With Quote