How to modify the datatables editor json format? and turn multiple keys into an array?

How to modify the datatables editor json format? and turn multiple keys into an array?

jumpcojumpco Posts: 1Questions: 1Answers: 0
edited January 2020 in Free community support

how to modify the datatables editor json format and
turn multiple keys into an array?

current format

 "friends" : {
    "data" : {
      "0" : {  
        "name" : "Johnny",
        "age" : 17
               },
 "1" : {  
        "name" : "Johnny1",
        "age" : 18
               }
       }
}

preferred format

{ "friends": [ { 
   "name" : "Johnny",
    "age" : 17
       },
{ 
   "name" : "Johnny1",
    "age" : 18
       }
    ]
}

Thanks!

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

Answers

  • colincolin Posts: 15,142Questions: 1Answers: 2,586

    The code in this OP of this thread should do the trick,

    Colin

This discussion has been closed.