fixed filtering on 'name' only

This commit is contained in:
Maria Teresa Paratore 2023-12-11 12:26:44 +01:00
parent 01b7badfe1
commit a64bfc97dc
2 changed files with 14 additions and 7 deletions

View File

@ -72,8 +72,11 @@ export class TableScreenEsComponent implements OnInit, AfterViewInit, OnChanges
this.myDataService.fetchResourceImpls('',this.resourceType).subscribe(res => {
this.dataFromService = res;
this.dataSource.data = res;
console.debug(res);
//this is to filter only on the 'name' property
this.dataSource.filterPredicate = function (record:any,filter:string) {
return record.name.indexOf(filter)!==-1;
}
//console.debug(res);
});
}

View File

@ -72,10 +72,14 @@ export class TableScreenComponent implements OnInit, AfterViewInit, OnChanges {
this.myDataService.fetchResourceImpls('',this.resourceType).subscribe(res => {
this.dataFromService = res;
this.dataSource.data = res;
// console.debug("*****TABLE DATA*****");
// console.debug(res);
// console.debug("*****END*****");
//this is to filter only on the 'name' property
this.dataSource.filterPredicate = function (record:any,filter:string) {
return record.name.indexOf(filter)!==-1;
}
/*
this.dataSource.filterPredicate =
(data: IHostingNode, filter: string) => !filter || data.level == filter;
*/
});
}
@ -101,7 +105,7 @@ export class TableScreenComponent implements OnInit, AfterViewInit, OnChanges {
this.dataSource.filter = filterValue.trim().toLowerCase();
}
// per tabbed pane (versione con aggiunta dinamica)
// for the dynamic tabbed pane
removeTab(index: number): void {
this.tabs.splice(index, 1);