Improving common list displays

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

No files matched your search

@@ -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;
}