Add unique ID to grid wrapper
authorStephanie Leary <stephanie.leary@equinoxoli.org>
Tue, 28 Mar 2023 15:34:05 +0000 (15:34 +0000)
committerStephanie Leary <stephanie.leary@equinoxoli.org>
Tue, 28 Mar 2023 15:34:05 +0000 (15:34 +0000)
Signed-off-by: Stephanie Leary <stephanie.leary@equinoxoli.org>
Open-ILS/src/eg2/src/app/share/grid/grid.component.ts

index 01ba30c..0d8fcc1 100644 (file)
@@ -128,6 +128,8 @@ export class GridComponent implements OnInit, AfterViewInit, OnDestroy {
     @Input() reloadOnColumnChange = false;
 
     context: GridContext;
+    private static id: number = 0;
+    gridDomId: string = 'eg-grid-';
 
     // These events are emitted from our grid-body component.
     // They are defined here for ease of access to the caller.
@@ -158,6 +160,8 @@ export class GridComponent implements OnInit, AfterViewInit, OnDestroy {
             throw new Error('[egGrid] requires a [dataSource]');
         }
 
+        this.gridDomId += GridComponent.id++;
+
         this.context.idlClass = this.idlClass;
         this.context.dataSource = this.dataSource;
         this.context.persistKey = this.persistKey;