minor changes
This commit is contained in:
parent
e9d54e8f37
commit
970b8b87d2
|
@ -46,6 +46,11 @@ export class RscTreeComponent implements OnInit {
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
|
/*
|
||||||
|
this.myForm = this.formBuilder.group({
|
||||||
|
context: [],});
|
||||||
|
*/
|
||||||
|
|
||||||
this.resLoader.getResourcesByContext().subscribe(res => {
|
this.resLoader.getResourcesByContext().subscribe(res => {
|
||||||
this.nestedDataSource.data = res;
|
this.nestedDataSource.data = res;
|
||||||
});
|
});
|
||||||
|
@ -53,11 +58,18 @@ export class RscTreeComponent implements OnInit {
|
||||||
this.ctxLoader.getData().subscribe(res => {
|
this.ctxLoader.getData().subscribe(res => {
|
||||||
this.allContexts = res;
|
this.allContexts = res;
|
||||||
console.log('*******numero contesti...', res.length);
|
console.log('*******numero contesti...', res.length);
|
||||||
this.filteredContexts = this.chooseContextForm.get('namefield')?.valueChanges.pipe(
|
|
||||||
startWith(''),
|
|
||||||
map(name => (name ? this.doFilter(name) : this.allContexts.slice()))
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
this.filteredContexts = this.chooseContextForm.get('namefield')?.valueChanges.pipe(
|
||||||
|
startWith(''),
|
||||||
|
map(name => (name ? this.doFilter(name) : this.allContexts.slice()))
|
||||||
|
);
|
||||||
|
|
||||||
|
/*
|
||||||
|
this.myForm = this.formBuilder.group({
|
||||||
|
context: [],
|
||||||
|
});
|
||||||
|
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
hasNestedChild(_: number, node: IResource): boolean {
|
hasNestedChild(_: number, node: IResource): boolean {
|
||||||
|
@ -69,6 +81,7 @@ export class RscTreeComponent implements OnInit {
|
||||||
}
|
}
|
||||||
|
|
||||||
private doFilter(name: string): IContextNode[] {
|
private doFilter(name: string): IContextNode[] {
|
||||||
|
//return this.allContexts.filter(ctx => ctx.name.toLowerCase().includes(name.toLowerCase()));
|
||||||
return this.allContexts.filter(ctx => ctx.name.toLowerCase().includes(name.toLowerCase()));
|
return this.allContexts.filter(ctx => ctx.name.toLowerCase().includes(name.toLowerCase()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue