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 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 User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,050
    Answers
    3976
    Vote Rating
    1381
      0  

    Default

    Where do you have your proxy?
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Frontend Engineer
    ________________
    Need any sort of Ext JS help? Modus Create is here to help!

    Check out my GitHub:
    https://github.com/mitchellsimoens

  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 User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,050
    Answers
    3976
    Vote Rating
    1381
      0  

    Default

    Why are you alerting store.load()?
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Frontend Engineer
    ________________
    Need any sort of Ext JS help? Modus Create is here to help!

    Check out my GitHub:
    https://github.com/mitchellsimoens

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
  •