I use the following tool for serializing and deserializing JSON:
http://james.newtonking.com/pages/json-net.aspx
It's very easy to use and very lightweight.
While serializing we use this option:
JsonConvert.SerializeObject(myObject, Formatting.Indented,
new JsonSerializerSettings {
ReferenceLoopHandling = ReferenceLoopHandling.Ignore
})
It ignores circular references.
Also json.net from newtonking is extremely fast.
The other options is to use DTO's and map them via Automapper as mentioned by Diver.
Edit: I suspect your store is wrong:
var store = Ext.create('Ext.data.JsonStore', {
storeId: 'myData',
reader: new Ext.data.JsonReader({
root: 'myTable',
fields: [{ name: 'Q1', type: 'int' },
{ name: 'Q2', type: 'int' },
{ name: 'Q3', type: 'int' },
{ name: 'Q4', type: 'int' },
{ name: 'Q5', type: 'int' },
{ name: 'Improvements', type: 'string' },
{ name: 'Comments', type: 'string'}]
}),
proxy: {
type: 'json',
url: 'GridView/writeRecord'
}
});
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…