diff --git a/DigitalData.UserManager.API/ClientApp/user_manager_ui/src/app/components/group/group.component.ts b/DigitalData.UserManager.API/ClientApp/user_manager_ui/src/app/components/group/group.component.ts index 6bae132..6307176 100644 --- a/DigitalData.UserManager.API/ClientApp/user_manager_ui/src/app/components/group/group.component.ts +++ b/DigitalData.UserManager.API/ClientApp/user_manager_ui/src/app/components/group/group.component.ts @@ -14,13 +14,15 @@ import { GuiSelectedRow } from '@generic-ui/ngx-grid'; }) export class GroupComponent implements AfterViewInit { initWithoutData = () => { } - + private sGroupId = null; constructor(private refreshService: RefreshService) { } ngAfterViewInit(): void { this.refreshService.removeAll() this.refreshService.add(() => { this.groupTable.fetchData(); + if(this.sGroupId) + this.userTable.fetchDataByGroupId(this.sGroupId); }); } @@ -28,7 +30,10 @@ export class GroupComponent implements AfterViewInit { @ViewChild("userTable") userTable!: UserTableComponent; groupsOnSelectedRows = (rows: GuiSelectedRow[]) => { - const groupId = rows[0].source.id; - this.userTable.fetchDataByGroupId(groupId); + if(rows.length > 0){ + this.sGroupId = rows[0].source.id; + if(this.sGroupId) + this.userTable.fetchDataByGroupId(this.sGroupId); + } } }