How can I get the JSON of interactive report without using index of rows to find the id ?
Here’s my code to create JSON :
let json_array = [];
var grid =document.getElementsByClassName("CLASSNAME");
var allRow =$(grid[1]).find('tr');
for (j=1 ; j < allRow.length ; j++ ) {
var row =$(allRow[j]).find('td');
var ID = $(row[0]).find('a').attr('data_id');
///and others .......
json_array.push(text)
}
json_array = '[' + json_array + ']'
as it seems if I or any users change the order of columns , the JSON’s data columns would be corrupted. Is there any ways to create the JSON without having problems like this and use something like data-id instead of row index ?