feat: RefreshService zu UserComponent hinzugefügt und angewendet
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { Component, ViewChild } from '@angular/core';
|
||||
import { AfterViewInit, Component, ViewChild } from '@angular/core';
|
||||
import { GuiCellEdit } from '@generic-ui/ngx-grid';
|
||||
import { UserTableComponent } from '../tables/user-table/user-table.component';
|
||||
import { RefreshService } from '../../services/refresh.service';
|
||||
|
||||
@Component({
|
||||
standalone: true,
|
||||
@@ -9,8 +10,7 @@ import { UserTableComponent } from '../tables/user-table/user-table.component';
|
||||
templateUrl: './user.component.html',
|
||||
styleUrl: './user.component.css'
|
||||
})
|
||||
export class UserComponent {
|
||||
|
||||
export class UserComponent implements AfterViewInit {
|
||||
cellEditing: GuiCellEdit = {
|
||||
enabled: true,
|
||||
rowEdit: (value: any, item: any, index: number) => {
|
||||
@@ -21,7 +21,14 @@ export class UserComponent {
|
||||
}
|
||||
}
|
||||
|
||||
constructor(private refreshService: RefreshService) { }
|
||||
|
||||
ngAfterViewInit(): void {
|
||||
this.refreshService.removeAll()
|
||||
this.refreshService.add(() => {
|
||||
this.userTable.fetchData();
|
||||
});
|
||||
}
|
||||
|
||||
@ViewChild("userTable") userTable!: UserTableComponent
|
||||
}
|
||||
Reference in New Issue
Block a user