PDA

View Full Version : EXTJS session storage



oana0211
5 Jun 2013, 1:25 AM
Hello,

I don't know to save data in my session storage. I've made an model and a session storage but when I want to save some data in my session storage I see in my items only id : 1 . How to access my properties?

My code is :

Ext.define('myApp.model.SessionModel', {
extend : 'Ext.data.Model',

config : {
fields : [ {
name : 'menuId',
type : 'string'
}, {
name : 'sessionToken',
type : 'string'
} ]
}
});

Ext.define('myApp.store.SessionStore', {
extend : 'Ext.data.Store',

requires: ['myApp.model.SessionModel'],

storeId : 'sessionStoreId',
model: 'myApp.model.SessionModel',
proxy: {
type: 'sessionstorage',
id : 'sessionProxyId'

},
autoLoad: true

});

----
var sessionStore = Ext.getStore('SessionStore');
var model = Ext.create('myApp.model.SessionModel');
model.set({menuId: '123' , sessionToken : '456'});
sessionStore.add(model);

Thank you.

oana0211
6 Jun 2013, 5:22 AM
I've solved. It was my error in my model. Thanks