Reputation: 7
I want to create the below object dynamically in JSON as per the below format. Data will be from a different source which i will be getting from Ajax. Can you please let me know how to create the JSON dynamically.
window.store1 = new Ext.data.JsonStore({
fields: ['name', '2008', '2009', '2010','2011', 'data4', 'data5', 'data6', 'data7', 'data9', 'data9', 'data10', 'data11'],
data: generateData(5, 20)
});
Upvotes: 0
Views: 927
Reputation: 161674
var d = {
fields: ['name', '2008', '2009', '2010','2011', 'data4', 'data5', 'data6', 'data7', 'data9', 'data9', 'data10', 'data11'],
data: 'You Data'
}
var json = JSON.stringify(d)
Upvotes: 1