PDA

View Full Version : [CLOSED] data.Store sync() method returning error after 0.91



tmtrademark
30 Jun 2010, 3:07 PM
Greetings.

I am using a data.Store with a localStorageProxy like this:



charStore = new Ext.data.Store({
proxy: new Ext.data.LocalStorageProxy({
id: 'charStore-Proxy'
}),
autoload: true,
id: 'characterStorage',
storeId: 'store4char',
model: 'Character',
});

When I create a new record and add it to the store, then call charStore.sync(), everything is fine:



charStore.add(Ext.ModelMgr.create({name: thisChar.stats.name, character: thisChar}, 'Character'));
charStore.sync();


However, attempting to add any subsequent records causes this error:



ext-touch-debug-w-comments.js:8037 TypeError: JSON.stringify cannot serialize cyclic structures.

Had never seen this before. Commenting out the sync() function makes everything perform as expected.

TommyMaintz
30 Jun 2010, 4:10 PM
We don't immediately see the problem here and aren't able to reproduce it. Could you please provide the Character model definition? Even better would be to give us a copy of your javascript so we can look at it and hopefully reproduce the problem. If you dont want your source code to be public you can send it to [email protected]

edspencer
23 Jul 2010, 2:41 PM
@tmtrademark if you are still getting this behavior please post a reproducible test case otherwise we'll close the ticket as it appears to work in all of our tests.