How to embed a child table into a column?

How to embed a child table into a column?

iamcyberiamcyber Posts: 2Questions: 1Answers: 0
edited November 2021 in DataTables

Hi all,

I need some help from you.

I would like to display details within a column. The data source is JSON likes beblow:

{
"OfferDetails": [
        {
            "OfferName": "Full Offer",
            "OfferStatus": "Available",
            "OfferType": "Primary",
            "Season": "Season 2020/2021",
            "Products": [
                {
                    "Name": "Car Pass - Full",
                    "MemberOfferProductID": "108906",
                    "ProductNumber": "P000310",
                    "Quantity": "1"
                },
                {
                    "Name": "Members Subscriptions - Full Members",
                    "MemberOfferProductID": "108904",
                    "ProductNumber": "P000158",
                    "Quantity": "1"
                },
                {
                    "Name": "Members Subscriptions - Full Members Guest",
                    "MemberOfferProductID": "108905",
                    "ProductNumber": "P000159",
                    "Quantity": "1"
                },
                {
                    "Name": "Full Member Joining Fees",
                    "MemberOfferProductID": "108907",
                    "ProductNumber": "P000665",
                    "Quantity": "1"
                }
            ]
        },
        {
            "OfferName": "Absentee Full Offer",
            "OfferStatus": "Available",
            "OfferType": "Alternate",
            "Season": "Season 2020/2021",
            "Products": [
                {
                    "Name": "Full Member Joining Fees",
                    "MemberOfferProductID": "108909",
                    "ProductNumber": "P000665",
                    "Quantity": "1"
                },
                {
                    "Name": "Annual Absentee Fee Full",
                    "MemberOfferProductID": "108908",
                    "ProductNumber": "P000326",
                    "Quantity": "1"
                }
            ]
        }
    ]

Any ideas to build a table like this:

Cheers

Edited by Colin - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,143Questions: 1Answers: 2,586
    Answer ✓

    You can do something like this - it creates a DataTable with all the rows for the products.

    You could also do something like this - where the products would be child rows, but still a DataTable,

    Colin

  • iamcyberiamcyber Posts: 2Questions: 1Answers: 0

    Thanks Colin. The first example looks great.

Sign In or Register to comment.