I want to add a array of objects to a specific entry of an odata array. It is a JSON-Model in sapui5 and I wanted to do oModel.getData()[j].setProperty(""), but this does not. Can anyone help?
I have:
[{
attributes: (5) [{…}, {…}, {…}, {…}, {…}]
creationDate: "2019-05-20T09:14:16.622Z"
deleted: false
eventDate: "20.05.19"
message: "Aufgabe xyz"
object: "Aufgabe"
},
{
attributes: (5) [{…}, {…}, {…}, {…}, {…}]
creationDate: "2019-05-20T09:14:16.622Z"
deleted: false
eventDate: "21.05.19"
message: "Aufgabe"
object: "Aufgabe" }
]
And I want to add a new Item:
[{
description: "Ereignisgruppe"
key: "objectGroup"
value: "Aufgaben"
},{
description: "Ereignis"
key: "object"
value: "Aufgabe"
}]
To get this:
[{
attributes: (5) [{…}, {…}, {…}, {…}, {…}]
creationDate: "2019-05-20T09:14:16.622Z"
deleted: false
eventDate: "20.05.19"
message: "Aufgabe xyz"
object: "Aufgabe",
masterAttributes: (2) [{…}, {…}] <-------------- new
},
{
attributes: (5) [{…}, {…}, {…}, {…}, {…}]
creationDate: "2019-05-20T09:14:16.622Z"
deleted: false
eventDate: "21.05.19"
message: "Aufgabe"
object: "Aufgabe"
}]
Best regards!