Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there anyway to return other data inside of the javascript treemap json?

I have an asp.net mvc website and am using javascript treemap control to display a heatmap. This control works great but i wanted to see if i can stick some other json fields into the callback that is used to update another div.

Does anyone know if this is possible. Right now I have to bounce back and forth and do 2 seperate ajax calls but i wanted to see if i can pass along this info along with the treemap json response.

like image 717
leora Avatar asked Mar 07 '12 04:03

leora


1 Answers

What you would need to do is a single call in which you work out the callback yourself. Here the json would be a structure like

var data = {
  heatmap_data: {}
  other_data: {}
}

and next call

tm.loadJSON(data.heatmap_data);  

to load the heatmap data and use all the other data to your own liking. That should do the trick right? At least, that is if loadJSON takes an object as seems to be the case. Still, this answer seems too simple, so I might be totally missing the point.

like image 189
David Mulder Avatar answered Sep 24 '22 02:09

David Mulder