PDA

View Full Version : Make JSON of Ext.data.Store method getRange()



extjser12
17 May 2012, 2:33 AM
Hello together

Can somebody help me to convert the result of the method "getRange()" of Ext.data.Store to JSON? The JSON should contain all records of the resulted array.

Thank you very much for your help!

Kind regards, extjser12

sword-it
17 May 2012, 2:55 AM
Hi,
I am giving the demo to convert the getRange() result into json data.Review the following code -


var resultData = store.getRange() // getting the result from getRange() of Ext.data.Store class
, data = { // data is the variable where we will store the json data.
item: []
};
for(var i=0,totalRecords = resultData.length;i<totalRecords;i++){
data.item.push(resultData[i].data);
}