Nested object data dynamically

Nested object data dynamically

ramonpegoramonpego Posts: 1Questions: 1Answers: 0

I want to display some information from some relationships in a table, which will "self-build" because it can change the structure, number of headers according to user selection.

For example

data: [
{
    id: "25238",
    title: "008/2018",
    date: "22/01/2018",
    categoria_id: "271",
    forms: [{
            title: "ORGÃO/UNIDADE",
            value: "SECRETARIA MUNICIPAL DE ADMINISTRAÇÃO E PLANEJAMENTO",
        
        },
        {
            title: "MODALIDADE",
            value: "TOMADA DE PREÇOS",
            
        },
        {
            title: "OBJETO",
            value: "CONTRATAÇÃO DE EMPRESA SOB O REGIME DE EXECUÇÃO EMPREITADA GLOBAL PARA A EXECUÇÃO DE OBRAS DE REVITALIZAÇÃO DO CAMPO MUNICIPAL DE FUTEBOL JOÃO MARTINS SENA",
            
        }
    ],
},
{
    id: "25241",
    title: "021/2018",
    date: "03/04/2018",
    categoria_id: "271",
    forms: [{
        ...
    }]
}

date and title are default values, all data have these two fields
but may have some specific fields that are returned in forms

ex
In the category of id 271
All documents linked to it have date and title and:
"ORGÃO/UNIDADE", "MODALIDADE" , "OBJETO"
and their respective values.

Then the table should form

|Titulo|Data| ORGÃO/UNIDADE |MODALIDADE| OBJETO|
|------|-----|--------------|----------|--------|

However some filters the values inside forms can only be
2,3, 4 or none.
Then it would have to be generated automatically.

Answers

This discussion has been closed.