Results 1 to 4 of 4

Thread: LocalStorage heeeelp

  1. #1
    Sencha User
    Join Date
    Mar 2012
    Location
    Tunisia
    Posts
    74
    Vote Rating
    1
      0  

    Default 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
    Code:
    var store =newExt.data.Store({    model:"Search"});
    and i create a form and put into it

    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());
                       }
    },
    and when i execute it it shows me int the alert as result (Object object).

    how can i use the local storage to save data in my app and how can i retreive this data later.
    thank youuuuuuuuuuuuu

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,326
    Answers
    3884
    Vote Rating
    1297
      0  

    Default

    Where do you have your proxy?
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    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 in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Mar 2012
    Location
    Tunisia
    Posts
    74
    Vote Rating
    1
      0  

    Default

    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'}});

  4. #4
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,326
    Answers
    3884
    Vote Rating
    1297
      0  

    Default

    Why are you alerting store.load()?
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    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 in print!

    When posting code, please use BBCode's CODE tags.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •