From e6110901d9e008c20b98443d50fd15f8f21c2bc9 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Mon, 18 Mar 2019 15:05:41 -0400 Subject: [PATCH] lpxxx Grid data loading progress Signed-off-by: Bill Erickson --- .../src/eg2/src/app/share/grid/grid.component.html | 18 +++++++++++++----- Open-ILS/src/eg2/src/app/share/grid/grid.ts | 10 +++++++++- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/Open-ILS/src/eg2/src/app/share/grid/grid.component.html b/Open-ILS/src/eg2/src/app/share/grid/grid.component.html index a98e17afaf..55e556b969 100644 --- a/Open-ILS/src/eg2/src/app/share/grid/grid.component.html +++ b/Open-ILS/src/eg2/src/app/share/grid/grid.component.html @@ -15,12 +15,20 @@ - -
-
- Nothing to Display + +
> + +
+ +
+
+ +
+ Nothing to Display +
+
-
+
diff --git a/Open-ILS/src/eg2/src/app/share/grid/grid.ts b/Open-ILS/src/eg2/src/app/share/grid/grid.ts index d717c428fd..80c8518657 100644 --- a/Open-ILS/src/eg2/src/app/share/grid/grid.ts +++ b/Open-ILS/src/eg2/src/app/share/grid/grid.ts @@ -930,6 +930,7 @@ export class GridDataSource { data: any[]; sort: any[]; allRowsRetrieved: boolean; + requestingData: boolean; getRows: (pager: Pager, sort: any[]) => Observable; constructor() { @@ -965,16 +966,23 @@ export class GridDataSource { return Promise.resolve(); } + // If we have to call out for data, set inFetch + this.requestingData = true; + return new Promise((resolve, reject) => { let idx = pager.offset; return this.getRows(pager, this.sort).subscribe( - row => this.data[idx++] = row, + row => { + this.data[idx++] = row; + this.requestingData = false; + }, err => { console.error(`grid getRows() error ${err}`); reject(err); }, () => { this.checkAllRetrieved(pager, idx); + this.requestingData = false; resolve(); } ); -- 2.11.0