In the process of developing a function, I encountered an issue where all elements added to the array were only stored in Array[0] of the rowData. The data is retrieved from a database.
private createRowData() {
var rowData:any[] = [];
this.wakanda.catalog.then(ds => {
ds.Group.query({select : 'groupName'}).then(op => {
for(let entity of op['entities']){
rowData.push(
{row : entity.groupName});
}
});
});
return rowData;
}
The current output looks like this:
https://i.sstatic.net/jpIVs.png
I am aiming for an output similar to this:
https://i.sstatic.net/Oshnw.png
If anyone has suggestions on how to resolve this issue, it would be greatly appreciated.
Thank you in advance!