PDA

View Full Version : [1.1.0] Data of Localstorage disappear



conscience
18 Aug 2011, 7:47 AM
Hi,

I have a really strange behavior of my store.

My Store has a local storage proxy and the model to, for sure.

When I work with the store, add something, change something and so on ... any thing is fine. But when I restart the app (or reload it in the browser), the store can't find the data in the local storage, but the store knows how many records he have ...

I have defined the store and models the same way we do it all the time till now in our project. The only difference between this buggy store and the others, is that I now use associations, are they buggy in some way ?

thanks for any help :)

conscience
19 Aug 2011, 1:10 AM
Has nobody an idea ?

Here are some code snippets for more information about the structure:



SomeModel = Ext.regModel('SomeModel', {
fields: [
{name: 'id', type: 'int'},
{name: 'date', type: 'date', dateFormat:'d.m.Y'},
{name: 'time', type: 'date', dateFormat:'H:i'},
{name: 'street', type: 'string'},
],

proxy: {
type: 'localstorage',
id : 'someModel'
},

associations: [
{type: 'hasMany', model: 'SomeAssocModel', name: 'someAssocModel'},
],
});

SomeAssocModel = Ext.regModel('SomeAssocModel', {
fields: [
{name: 'id', type: 'int'},
{name: 'somemodel_id', type: 'int'},
{name: 'someFields', type: 'boolean'},
],

proxy: {
type: 'localstorage',
id : 'someAssocModel'
},

associations: [
{type: 'belongsTo', model: 'SomeModel'}
],
});

Store = new Ext.data.Store({
storeId: 'SomeStore',
model: 'SomeModel',
autoLoad: true,
proxy: {
type: 'localstorage',
id : 'someModel',
},
});