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

      0  

    Question data store in sencha

    data store in sencha


    i have the json file got from server
    Code:
    {
        "success":"res",
        "result":[["Questionno11",
                "O1",
                "O2",
                "A1"
            ],
            ["Questionno2",
                "O1",
                "O2",
                "A2"
            ]
        ]
    }
    in the form submit page
    Code:
    Ext.dispatch({
                                 controller: 'quizloader',
                                action    :'test',
                                record:res,
                                
                                 });
    in the controller page
    Code:
    test:function(param){
          console.log(param.test[0]);
          console.log(param.record);
          alert(param.record);
     //some loop there
                 this.store.create(param.record);//param.record is probably error 
    //end loop
                 this.index();
            },
    I want to store the each question from the json separtly in localstorage
    i have the model
    Code:
    App.models.quiz=Ext.regModel('quiz', {
                fields: [
                         {name:'result',type:'auto'}
                         ],
                
                proxy: {
                    type: 'localstorage',
                    id  : 'testuser'
                }
            });

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,047
    Vote Rating
    850
    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


    You can try

    http://docs.sencha.com/touch/1-1/#!/...ta.ArrayReader

    and set the root as 'results'
    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.

Thread Participants: 1