LP#1775466 Grid pageOffset option
authorBill Erickson <berickxx@gmail.com>
Thu, 12 Jul 2018 15:04:40 +0000 (11:04 -0400)
committerBill Erickson <berickxx@gmail.com>
Thu, 12 Jul 2018 21:33:54 +0000 (17:33 -0400)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/eg2/src/app/share/grid/grid.component.ts

index 06522f6..9135e7c 100644 (file)
@@ -63,6 +63,10 @@ export class GridComponent implements OnInit, AfterViewInit, OnDestroy {
     // just to mark it hidden.
     @Input() hideFields: string;
 
+    // Allow the caller to jump directly to a specific page of 
+    // grid data.
+    @Input() pageOffset: number;
+
     context: GridContext;
 
     // These events are emitted from our grid-body component.
@@ -100,6 +104,10 @@ export class GridComponent implements OnInit, AfterViewInit, OnDestroy {
             this.context.defaultHiddenFields = this.hideFields.split(',');
         }
 
+        if (this.pageOffset) {
+            this.context.pager.offset = this.pageOffset;
+        }
+
         // TS doesn't seem to like: let foo = bar || () => '';
         this.context.rowClassCallback =
             this.rowClassCallback || function () { return ''; };