Improving common list displays

This commit is contained in:
2023-03-09 17:44:30 +01:00
parent 1e3855ced5
commit a52435d443
5 changed files with 18 additions and 12 deletions

View File

@@ -75,10 +75,16 @@ export class ListComponent implements OnInit {
}
}
getColumnValue(row: any, col: string) {
getColumnValue(row: any, col: string): string {
let parent = row;
for (const key of col.split('.')) {
parent = parent[key];
if (key == 'items' && Array.isArray(parent)) {
let path_parts = col.split(/items\.(.*)/s);
let subkey = path_parts[1]
return parent.map((v: any) => this.getColumnValue(v, subkey)).join(', ');
} else {
parent = parent[key];
}
}
return parent;
}