From 041d2576a573c1ff8bd0b1c2c40ef878c07f8ca7 Mon Sep 17 00:00:00 2001 From: Jane Sandberg Date: Sun, 11 Aug 2019 07:59:35 -0700 Subject: [PATCH] valuechanges --- .../eg2/src/app/staff/cat/authorities/manage.component.html | 4 ++-- .../src/eg2/src/app/staff/cat/authorities/manage.component.ts | 11 ++++++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Open-ILS/src/eg2/src/app/staff/cat/authorities/manage.component.html b/Open-ILS/src/eg2/src/app/staff/cat/authorities/manage.component.html index 3fd775b9d6..a5019193f4 100644 --- a/Open-ILS/src/eg2/src/app/staff/cat/authorities/manage.component.html +++ b/Open-ILS/src/eg2/src/app/staff/cat/authorities/manage.component.html @@ -6,8 +6,8 @@ -{{field}} - diff --git a/Open-ILS/src/eg2/src/app/staff/cat/authorities/manage.component.ts b/Open-ILS/src/eg2/src/app/staff/cat/authorities/manage.component.ts index 57edd83a80..6f69db09be 100644 --- a/Open-ILS/src/eg2/src/app/staff/cat/authorities/manage.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/cat/authorities/manage.component.ts @@ -1,9 +1,11 @@ +import { GridComponent } from '@eg/share/grid/grid.component'; import {FormGroup, FormControl} from '@angular/forms'; import {PcrudService} from '@eg/core/pcrud.service'; -import {Component} from '@angular/core'; +import {Component, ViewChild} from '@angular/core'; import {GridDataSource} from '@eg/share/grid/grid'; import {Pager} from '@eg/share/util/pager'; import { IdlObject } from '@eg/core/idl.service'; +import { of } from 'rxjs'; @Component({ templateUrl: './manage.component.html', @@ -12,6 +14,7 @@ export class ManageAuthoritiesComponent { gridSource: GridDataSource; search: FormGroup; authorityFields: IdlObject[] = []; + @ViewChild('authoritiesGrid') authoritiesGrid: GridComponent; constructor( private pcrud: PcrudService @@ -20,6 +23,10 @@ export class ManageAuthoritiesComponent { field: new FormControl() }); + this.field.valueChanges.subscribe( + () => this.authoritiesGrid.reload() + ); + this.pcrud.search('acsaf', {'main_entry': null}) .subscribe((field) => this.authorityFields.push(field)); @@ -38,6 +45,8 @@ export class ManageAuthoritiesComponent { ash: ['record'] } }); + } else { + return of(); } }; } -- 2.11.0