Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82566

How do you display a single row for a nested complex array of objects

$
0
0

Given this sample JSON data:

"data":[
    {
        "details":[
            {
                "year":"2017",
                "description":"bla bla bla 2017",
                "producer":"Mrs. Producer",
                "url":"www.somewhere.com/checkbox",
                "director":"Mrs. director"
            },
            {
                "year":"1991",
                "description":"bla bla bla 1992",
                "producer":"Mr. Producer",
                "url":"www.somewhere.com/checkbox",
                "director":"Mr. director"
            }
        ],
        "moviename":"Beauty and the Beast"
    },
    {
        "details":[
            {
                "year":"2012",
                "description":"bla bla bla 2012",
                "producer":"Mrs. Producer",
                "url":"www.somewhere.com/checkbox",
                "director":"Mrs. director"
            },
            {
                "year":"1994",
                "description":"bla bla bla 1994",
                "producer":"Mr. Producer",
                "url":"www.somewhere.com/checkbox",
                "director":"Mr. director"
            }
        ],
        "moviename":"Red Dawn"
    }
]

}

I want to display a single row for the nested "details" array. Expected datatable would look like

   Movie Name                  Year            Producer          Director              Description

Beauty and the Beast 1991 Mr. Producer Mr. Director bla bla bla 1991
Beauty and the Beast 2017 Mrs. Producer Mrs. Director bla bla bla 2017
Red Dawn 1984 Mr. Producer Mr. Director bla bla bla 1984
Red Dawn 2012 Mrs. Producer Mrs. Director bla bla bla 2012

Please excuse any type-0, but my goal is to produce a singe row for each year repeating the Movie name when necessary.

I am able to produce a list in a cell on a row, which not what I want.

Thanks for any help.


Viewing all articles
Browse latest Browse all 82566

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>