Parse JSON in Ext JS 4 or JavaScript

anupkumar picture anupkumar · Feb 7, 2013 · Viewed 15.9k times · Source

I have this type of JSON:

{"value":[{"idProductCategoryAttributeValue":43,"value":"7","sortOrder":0}]}

I want the individual parameters values like. How do I parse this JSON string in Ext JS 4 or in simple JavaScript?

Answer

devOp picture devOp · Feb 7, 2013

Have a look at http://docs.sencha.com/ext-js/4-1/#!/api/Ext.JSON. There you find how you can parse JSON with Ext JS 4.

var strJson = '{"value": [{"idProductCategoryAttributeValue":43,"value":"7","sortOrder":0}]}';
var obj = Ext.JSON.decode(strJson);