Improving common list displays
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user