🍉 Meet Flexmonster Pivot Table & Charts 2.9.Check out all the hot features!
Get Free Trial

Associate metadata with report.data json

Ankush asked on February 18, 2019

Is it possible to associate some id/metadata with each object in report JSON. And receive them as well, when a cell is clicked.
e.g. In this fiddle http://jsfiddle.net/flexmonster/5bv9bfbr/ lets say I want to add id’s to jsonData object as shown below and if user clicks on a cell(having value 174 with “green” as row and  “Canada” as country), currently rows[0].caption object on “cellClick” event contains “green” as value, instead I want to get “id”=1 as well. Is there a way ? please sugest :-
var jsonData = [{“Color”:{“id”:1,”value”:”green”},”Country”:{“id”:34,”value”:”Canada”},”State”:{“id”:56,”value”:”Ontario”},”City”:{“id”:17,”value”:”Toronto”},”Price”:174,”Quantity”:22},{“Color”:{“id”:2,”value”:”red”},”Country”:{“id”:32,”value”:”USA”},”State”:{“id”:57,”value”:”California”},”City”:{“id”:18,”value”:”Los Angeles”},”Price”:166,”Quantity”:19}]

1 answer

Dmytro Zvazhii Dmytro Zvazhii Flexmonster February 19, 2019

Hello Ankush,
Thank you for your question. 
It seems that you are looking for the property data type. You can refer to the following article for more information: https://www.flexmonster.com/doc/data-types-in-json/.
Also here is a small example which describes the idea: https://jsfiddle.net/flexmonster/nm09d7zh/.
Please let us know if everything works fine for you.

Please login or Register to Submit Answer