feat: UserTable und MatTabsModule zu GroupComponent hinzugefügt, dynamische Benutzerfilterung bei Gruppenauswahl integriert

This commit is contained in:
Developer 02 2024-07-25 00:39:46 +02:00
parent fe6d8618ce
commit 4f4b9711c7
2 changed files with 31 additions and 3 deletions

View File

@ -1 +1,18 @@
<app-group-table #groupTable></app-group-table>
<div class="container-fluid text-center">
<div class="row m-0 p-0">
<div class="col-6">
<mat-tab-group>
<mat-tab label="Gruppen">
<app-group-table #groupTable [onSelectedRows]="groupsOnSelectedRows"></app-group-table>
</mat-tab>
</mat-tab-group>
</div>
<div class="col-6">
<mat-tab-group>
<mat-tab label="Benutzer">
<app-user-table #userTable [initData]="initWithoutData"></app-user-table>
</mat-tab>
</mat-tab-group>
</div>
</div>
</div>

View File

@ -1,15 +1,20 @@
import { AfterViewInit, Component, ViewChild } from '@angular/core';
import { GroupTableComponent } from '../../components/tables/group-table/group-table.component';
import { UserTableComponent } from '../../components/tables/user-table/user-table.component';
import { RefreshService } from '../../services/refresh.service';
import { MatTabsModule } from '@angular/material/tabs';
import { GuiSelectedRow } from '@generic-ui/ngx-grid';
@Component({
standalone: true,
imports: [GroupTableComponent],
imports: [GroupTableComponent, UserTableComponent, MatTabsModule],
selector: 'app-group',
templateUrl: './group.component.html',
styleUrl: './group.component.css'
})
export class GroupComponent implements AfterViewInit {
initWithoutData = () => { }
constructor(private refreshService: RefreshService) { }
ngAfterViewInit(): void {
@ -19,5 +24,11 @@ export class GroupComponent implements AfterViewInit {
});
}
@ViewChild("groupTable") groupTable!: GroupTableComponent
@ViewChild("groupTable") groupTable!: GroupTableComponent;
@ViewChild("userTable") userTable!: UserTableComponent;
groupsOnSelectedRows = (rows: GuiSelectedRow[]) => {
const groupId = rows[0].source.id;
this.userTable.fetchDataByGroupId(groupId);
}
}