PDA

View Full Version : Encode store data into a String



Nagadev
17 Aug 2009, 11:13 PM
Can anyone give me a way to encode store data into a String ?

I have the store data in a Json Format,
{"approvals":[{"sequence":"1","appId":"1"},{"sequence":"2","appId":"2"}]}

I tried with
Ext.encode(st.data) and Ext.encode(st.data.approvals) but no luck. My intension is to submit the store data from a form as a hidden field value.

Condor
17 Aug 2009, 11:38 PM
Use:

var data = [];
store.each(function(r){
data.push(r.data);
});
var jsonData = Ext.encode({approvals: data});

Nagadev
18 Aug 2009, 1:14 AM
That was a gunshot.. thanks man,