Generate Child Row from Nested Object Using Ajax
Generate Child Row from Nested Object Using Ajax
Hi,
I'm trying to loop through the nested object that contains an array. I am able to successfully render it in the main table as a td but not as a child row (it returns object object). I'm not sure if I'm missing something.
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
The
valuevariable is an object, for example:{office: 'London'}. You need to usevalue.officeto haveLondondisplayed. See this updated example:http://live.datatables.net/rifeheko/4/edit
Kevin
Hi,
Thanks for the reply. It works in the updated example however when I try in my project files a error in the console shows:
Uncaught TypeError: Cannot read properties of undefined (reading 'location')When I try to console.log(d) it comes back as undefined
Undefined means
ddoesn't exist in the function. The example hasfunction format(d){...}. Do you havedas the parameter?Kevin
Hi,
I realized my mistake was that I was referencing the wrong table on
td.details-controlclick.Thanks for the help