Need a special offer?Find out if your project fits.
+

Associate metadata with report.data json

Resolved
Ankush asked on February 18, 2019

Hi,
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

Public
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/managing-data-presentation-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.
Regards,
Dmytro

Please login or Register to Submit Answer