Ich möchte eines unter JSON-Format in das entsprechende JSON-Format konvertieren. Die Json ich von Rast Dienstleistungen erhalten nicht die design.I müde unterstützt die folgenden ListenansichtKonvertiere ein JSON-Format in ein anderes
JSON-Format (I erhalten von Ruhe Dienstleistungen)
{
"ActionHistory": [{
"id": "action",
"name": "Action History",
"children": [{
"childrenItem": {
"id": "action1",
"type": "fa fa-info",
"empId": "101",
"ActionDate": "on 18-Apr-2017 18:20:32",
"Action": "Submit",
"From": "Deb Raphaely",
"To": "Neena Kochlar",
"pic": "deb_avatar",
"Details": ""
}
}, {
"childrenItem": {
"id": "action2",
"type": "fa fa-info",
"empId": "101",
"ActionDate": "on 19-Apr-2017 18:20:32",
"Action": "Approve",
"From": "Neena Kochlar",
"To": "James",
"pic": "neena_avatar",
"Details": ""
}
}]
},
{
"id": "action",
"name": "Action History2",
"children": [{
"childrenItem": {
"id": "action1",
"type": "fa fa-info",
"empId": "101",
"ActionDate": "on 18-Apr-2017 18:20:32",
"Action": "Submit",
"From": "Deb Raphaely",
"To": "Neena Kochlar",
"pic": "deb_avatar",
"Details": ""
}
}, {
"childrenItem": {
"id": "action2",
"type": "fa fa-info",
"empId": "101",
"ActionDate": "on 19-Apr-2017 18:20:32",
"Action": "Approve",
"From": "Neena Kochlar",
"To": "James",
"pic": "neena_avatar",
"Details": ""
}
}]
}
]
}
JSON-Format Ich brauche zu implementieren
{
"ActionHistory": [
{
"attr": {
"id": "action",
"name": "Action History"
},
"children": [{
"attr": {
"id": "action1",
"type": "fa fa-info",
"empId": "101",
"ActionDate": "on 18-Apr-2017 18:20:32",
"Action": "Submit",
"From": "Deb Raphaely",
"To": "Neena Kochlar",
"pic": "deb_avatar",
"Details": ""
}
},
{
"attr": {
"id": "action2",
"type": "fa fa-info",
"empId": "101",
"ActionDate": "on 19-Apr-2017 18:20:32",
"Action": "Approve",
"From": "Neena Kochlar",
"To": "James",
"pic": "neena_avatar",
"Details": ""
}
}
]
}, {
"attr": {
"id": "action",
"name": "Action History"
},
"children": [{
"attr": {
"id": "action1",
"type": "fa fa-info",
"empId": "101",
"ActionDate": "on 18-Apr-2017 18:20:32",
"Action": "Submit",
"From": "Deb Raphaely",
"To": "Neena Kochlar",
"pic": "deb_avatar",
"Details": ""
}
},
{
"attr": {
"id": "action2",
"type": "fa fa-info",
"empId": "101",
"ActionDate": "on 19-Apr-2017 18:20:32",
"Action": "Approve",
"From": "Neena Kochlar",
"To": "James",
"pic": "neena_avatar",
"Details": ""
}
}
]
}
]
}
ich müde, um das JSON-Format und es funktionierte gut für JSON-Array mit einer Länge = 1. für größere Feldlänge es nicht funktioniert zu konvertieren. Hier ist mein Code https://jsfiddle.net/72mz5zft/
Bitte siehe [* Wie eine minimale, komplett erstellen und verifizierbares Beispiel *] (http://stackoverflow.com/help/mcve) und [* Wie stelle ich eine gute Frage? *] (http://stackoverflow.com/help/how-to-ask) – RobG