Parse JSON in Ext JS 4 or JavaScript

16,011

Solution 1

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);

Solution 2

var obj = Ext.decode(jsonstr);
Share:
16,011
anupkumar
Author by

anupkumar

I am a web developer from India.Working on open source frameworks and cms. I have a development experience with the quality coding style maintaining correct standards.

Updated on June 09, 2022

Comments

  • anupkumar
    anupkumar almost 2 years

    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?

  • Jordan Kasper
    Jordan Kasper over 11 years
    May want to escape your quotes in the strJson definition.
  • sra
    sra over 11 years
    This is just a shorthand for Ext.JSON.decode(). The answer is also in a lower quality then the first one (no text, no reference)