I return from the beginning to Restructure all the question:
I will receive the detail of a Master / detail of AgGrid, the problem is that I do not know how many elements I will receive or what is the key that I will receive, since they will change the elements and keys every x time.
In the 1st image, it is the result I want to obtain, I display the Master and it can be seen mocked that I get 4 groups (In red) (which may vary the number of elements that I will receive.)
And each group can have an x number of elements.
I remember that all this is the detail.
Image 2 is what I'm barely getting at the moment.
The data I have to take out without knowing your password, for example
value['name'] value['text']
I'm not good because as I said, the data will come different every x time
The problem is no longer to get that data, that just barely as you can see, I'm already accessing the attributes of the children with a series of objects. Foreach
The structure of the JSON as an example:
"masterdetail": [ {
"child1": [
{
}
],
"child2": [
{
}
],
}]
Remembering that 'x' childs can come and each child can come with 'x' fields.
The problem comes to me when I want to SHOW it in the html (by console it does not work for me)
This is done with this.detailCellRendererParams
template: function(params) {
--->>> MIS FOR EACHS.
return (
'<div class="aggrid--full-row-container"> ( el contenido )'
);
}
};
}
I come from PHP and JSP and I have always been able to insert a html output in the foreach, but here, if I put the foreach inside the return it does not leave me.
Then, and as a summary , get the data without the keys, I'm already slowly removing it with the console.log, but showing them inside the return I do not know how to do it because it will not let me put the foreach inside the return.
Thanks to everyone!