PDA

View Full Version : serialize the JsonStore content



Bogdan0x400
24 Feb 2011, 1:04 AM
How do you serialize the JsonStore content? I tried Ext.encode(store.data.items), but it throws an exception "too many recursions".

Condor
24 Feb 2011, 1:42 AM
A store record contains a link to the store, so you get circular references.

You want:

var data = [];
store.each(function(rec) {
data.push(rec.data);
});
data = Ext.encode(data);

Bogdan0x400
24 Feb 2011, 2:04 AM
Thanks!