I have JSON data coming to the client. I need to somehow extract the data so that I can skip it to get all the values โโof the name and number.
{ "summarydata": { "rows": [ { "name": "Cisco0 Webinar US", "count": "1" }, { "name": "Resource Nation CC", "count": "1" }, { "name": "test", "count": "10" }, { "name": "test", "count": "2" }, { "name": "Vendor Seek", "count": "1" } ] } } $.extend($.jgrid.defaults, { datatype: 'jsonstring' }, { ajaxGridOptions: { contentType: "application/json", success: function (data, textStatus) { if (textStatus == "success") { var thegrid = $("#BuyBackGrid")[0]; thegrid.addJSONData(data.data); var summaryresult = $.parseJSON(data.summarydata.rows[0]); alert(summaryresult );// this gives me null alert(data.summarydata.rows[0].name); //this gives me first name element which is "Cisco0 Webinar US" in my case. // alert($.parseJSON(data).summarydata.rows[0].name); } } //end of success }//end of ajaxGridOptions });
source share