1. #1
    Sencha User
    Join Date
    Mar 2012
    Location
    Tunisia
    Posts
    74
    Vote Rating
    0
    zied jouini is on a distinguished road

      0  

    Default 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
    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 - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    33,582
    Vote Rating
    433
    Answers
    3101
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    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.

  3. #3
    Sencha User
    Join Date
    Mar 2012
    Location
    Tunisia
    Posts
    74
    Vote Rating
    0
    zied jouini is on a distinguished road

      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 - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    33,582
    Vote Rating
    433
    Answers
    3101
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    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.