473,413 Members | 1,727 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,413 software developers and data experts.

Json

Hi,

we are trying to built a treemap highcharts with dynamic data,my json data looks as

[{"name":"PUNE","id":"0","color":"#50B432"},{"name" :"Helical","id":"0_1","parent":"0"},{"name":"ADVAN CE TEK ENGINEERS","id":"0_1_1","parent":"0_1"},{"name":"E PM-201500003470","value":2.1,"id":"0_1_1_1","parent": "0_1_1","drilldown":"201500003470","events":"{clic k: function () {EnquiryList (201500003470)}}"},{"name":"ThyssenKrupp Industries India Pvt Ltd-10925","id":"0_1_2","parent":"0_1"},{"name":"EPM-201500003600","value":13.16,"id":"0_1_2_1","parent ":"0_1_2","drilldown":"201500003600","events":"{cl ick: function () {EnquiryList (201500003600)}}"},{"name":"WMI Konecranes India Limited","id":"0_1_3","parent":"0_1"},{"name":"EPM-201500003411","value":0.85,"id":"0_1_3_1","parent" :"0_1_3","drilldown":"201500003411","events":"{cli ck: function () {EnquiryList (201500003411)}}"},{"name":"Planetary","id":"0_2", "parent":"0"},{"name":"WMI Konecranes India Limited","id":"0_2_1","parent":"0_2"},{"name":"EPM-201500003430","value":102.52,"id":"0_2_1_1","paren t":"0_2_1","drilldown":"201500003430","events":"{c lick: function () {EnquiryList (201500003430)}}"},{"name":"Special","id":"0_3","p arent":"0"},{"name":"ThyssenKrupp Industries India Pvt Ltd-10925","id":"0_3_1","parent":"0_3"},{"name":"EPM-201500003600","value":8.63,"id":"0_3_1_1","parent" :"0_3_1","drilldown":"201500003600","events":"{cli ck: function () {EnquiryList (201500003600)}}"}]

Without event i am able to display the treemap charts with nodes.I tried to pop up ajax form in the last child node click event.But click event not working ,becuase the event also i concatenated in the array.So it forms with " double quotes.I remove the double quotes in the front of click and the end i able to load the ajax form successfully.But i dont know how to remove the double quotes in the json data.Help me

Regards,
Sindhu.P
Dec 14 '15 #1
4 1272
Dormilich
8,658 Expert Mod 8TB
But i dont know how to remove the double quotes in the json data
you can’t. JSON only submits primitive data (strings, numbers, booleans) not functions. therefore removing the quotes would invalidate the JSON. as it is written there you would have to eval() that expression.
Dec 15 '15 #2
Hi Dormilich ,

Thanks for your reply.eval() is not working for me because i have to concatenate the string in the array.

I want to call the click event in treemap for the end child node.Help me to complete this.
Dec 16 '15 #3
Dormilich
8,658 Expert Mod 8TB
every time you have a "drilldown" property, you also have a click even with that same value. so I see two principal ways to do it. either update the setup code such that it adds the click event whenever there is a drilldown property, or go through that array (after you parsed the JSON) and add the event property as desired.
Dec 16 '15 #4
Thanks for your reply.I completed the task.Instead of using hte event in the array i declared it unser charts .

Now i m able to load ajax .
Dec 17 '15 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

16
by: G Matthew J | last post by:
http://htmatters.net/htm/1/2005/07/evaling-JSON.cfm This is more or less in response to Mr Crockford's admonition a few months ago, "fork if you must". Ironically, although in that usenet post...
20
by: Luke Matuszewski | last post by:
Welcome As suggested i looked into JSON project and was amazed but... What about cyclical data structures - anybody was faced it in some project ? Is there any satisactional recomendation... ...
2
by: Kevin Newman | last post by:
Hello, I noticed that the JavaScript library for JSON posted on json.org (http://www.json.org/json.js) is modifying Object.prototype (adding a method - toJSONString). I thought this was...
3
by: Adam | last post by:
I'm trying to retrieve some values from a json object, but instead it's giving me the property name. For example: var json = { "glossary": { "title": "example glossary" } }; console.log(json);...
2
by: ChrisO | last post by:
I've been pretty infatuated with JSON for some time now since "discovering" it a while back. (It's been there all along in JavaScript, but it was just never "noticed" or used by most until...
23
by: dhtmlkitchen | last post by:
JSON We all know what it is. In ECMAScript 4, there's a JSON proposal: Object.prototype.toJSONString String.prototype.parseJSON The current proposal, String.prototype.parseJSON, returns...
9
by: Jon Paal [MSMD] | last post by:
using json like ( {"Records": , "RecordCount":"1" } ) and jquery like: $.ajax({ .... success: function(json, status) {
6
by: Lasse Reichstein Nielsen | last post by:
Max <adsl@tiscali.itwrites: Not really. It shows that a particularly naïve implementation of a conversion from XML to JSON doesn't work well. What if the conversion of <e> some
0
by: crocodilu2008 | last post by:
JSON vs. XML JSON and XML are basically used for the same purpose—to represent and interchange data. I'll try to show you why you might want to use JSON rather than XML in an AJAX context by showing...
2
pradeepjain
by: pradeepjain | last post by:
i have a page post2.php which prints the json array like { page: 1, total: 239, rows: }, {id:'238',cell:}, {id:'237',cell:}, {id:'236',cell:}, {id:'235',cell:},
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.