0

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

"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?

  • what exactly do you want to achieve? can you give us a visual example? – Apostolos Sep 03 '20 at 06:00
  • https://gyazo.com/4c102b6b92031bf556e6a51ff1ce339d?token=a1d5863f2ae1a56f2aab9d8d96a32718 I need the third fourth fifth etc columns to contain the map[x].name values as their field. – James Gillies Sep 21 '20 at 14:37

0 Answers0