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 .