How to concatenate two different arrays

How to concatenate two different arrays

andreavelloneandreavellone Posts: 29Questions: 7Answers: 1

Hi,
I have two array:
- a[0] a[1] a[2]
- b[0] b[1] b[2]

I have to display in a single cell something like this
"a[0] q.ta: b[0] pz"
"a[1] q.ta: b[1] pz"
"a[2] q.ta: b[2] pz"

This is a sample json row, the a and b array are "materiali" and "movimenti"

"DT_RowId": "row_158",
      "ol": {
        "id": "158",
        "ol": "0",
        "fase": "1",
        "centrale": "Roma",
        "Data_Inizio": "2017-12-12",
        "Data_Fine": "2017-12-05",
        "cliente_id": "1",
        "fatturato": "1",
        "Materiali_id": "",
        "costi_materiali": null,
        "impiegati_id": null,
        "Time_Stamp": "2017-12-06 21:10:37"
      },
      "clienti": {
        "nome": "Italtel"
      },
      "materiali": [
        {
          "id": "7",
          "codice": "F-LCLC01-DX-B"
        },
        {
          "id": "8",
          "codice": "F-LCLC02-DX-B"
        },
        {
          "id": "9",
          "codice": "F-LCLC03-DX-B"
        }
      ],
      "movimenti": [
        {
          "id": "338",
          "quantita": "12"
        },
        {
          "id": "346",
          "quantita": "22"
        },
        {
          "id": "347",
          "quantita": "55"
        }

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 43,525Questions: 1Answers: 5,695 Site admin
    Answer ✓

    Use a renderer for this. You could simply loop over the arrays building up the string you need and then return it from the renderer.

    Allan

Sign In or Register to comment.