1. #1
    Sencha User
    Join Date
    Oct 2011
    Location
    India
    Posts
    10
    Vote Rating
    0
    mukund1a is on a distinguished road

      0  

    Post how to use Local Storage in sencha

    how to use Local Storage in sencha


    i have two piece of data i want to store it locally code for button handler

    quizload:function(b,e){var form = Ext.getCmp('register');
    form.submit({
    url:'someurl.php'
    method: 'POST',
    success: function (frm, res) {
    Ext.dispatch({
    controller: 'quizloader',
    action :'test',
    data :res.a,
    level:res.b
    });
    },
    failure: function (frm, res) {
    alert('Form no submit!');
    }
    });
    }
    where data and level are the data to store locally for the controller page
    Ext.regController('quizloader',{
    store: App.stores.quiz,
    test:function(param){
    this.store.create(param.data);//how to save both data here
    }
    });
    store is
    App.stores.quiz = new Ext.data.Store({
    model:'quiz',
    autoLoad: true,
    });
    controller is
    App.models.quiz=Ext.regModel('quiz', {
    fields: [
    {name:'level',type:'int'}
    ,
    {name:'data',type:'string'}
    ],
    proxy: {
    type: 'localstorage',
    id : 'testuser'
    }
    });
    how to proceed .

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,821
    Vote Rating
    836
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    First, when you post code, please wrap in the BBCode code tags by highlighting the code and hitting the code button in the toolbar of the editor.

    Using LocalStorageProxy is no different than using AjaxProxy or RestProxy.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    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
    Oct 2011
    Location
    India
    Posts
    10
    Vote Rating
    0
    mukund1a is on a distinguished road

      0  

    Default


    thanks