Prime React datatable nested JSON

UI Components for React
Post Reply
JaG
Posts: 2
Joined: 09 Jun 2020, 20:08

02 Sep 2020, 20:02

I would like to get some clarification on whether or not I can work with a nested JSON dataset in this format with the datatable.

Code: Select all

"name": "CategorizationTest",
  "collections": [
    {
      "name": "CollectionOne",
      "categories": [
        {
          "code": "001",
          "text": "Withdrawl"
        },

        {
          "code": "002",
          "text": "Point of sale purchase"
        },
        {
          "code": "003",
          "text": "Cardholder credit"
        },
        {
          "code": "004",
          "text": "Exchange Fee"
        }
      ],
      "mapDefinitions": [
        {
          "collectionName": "CollectionTwo",
          "required": true,
          "multiEntry": false,
          "alias": null
        },

        {
          "collectionName": "CollectionThree",
          "required": true,
          "multiEntry": true,
          "alias": "Third Collection"
        }
      ]
    }
I have read posts saying to flatten out this data and display it that way and others with the angular version saying I can just use map.name to get into the nested object. This doesn't work for me, so what is the best approach to displaying data from multiple layers of nesting in a react datatable?

Post Reply

Return to “PrimeReact”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests