LP1904036 Grid toolbarLabel option
authorBill Erickson <berickxx@gmail.com>
Mon, 15 Mar 2021 17:37:24 +0000 (13:37 -0400)
committerGalen Charlton <gmc@equinoxOLI.org>
Fri, 28 Oct 2022 00:13:26 +0000 (20:13 -0400)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Jane Sandberg <js7389@princeton.edu>
Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
Open-ILS/src/eg2/src/app/share/grid/grid-toolbar.component.html
Open-ILS/src/eg2/src/app/share/grid/grid.component.ts
Open-ILS/src/eg2/src/app/share/grid/grid.ts

index 492a583..db5cd3d 100644 (file)
@@ -4,6 +4,9 @@
 <div class="eg-grid-toolbar mb-2">
 
   <div class="btn-toolbar">
+    <span class="font-weight-bold mr-2" *ngIf="gridContext.toolbarLabel">
+      {{gridContext.toolbarLabel}}
+    </span>
 
     <!-- buttons -->
     <div class="btn-grp" *ngIf="gridContext.toolbarButtons.length || gridContext.isFilterable">
index dc8ac87..49a4bec 100644 (file)
@@ -120,6 +120,9 @@ export class GridComponent implements OnInit, AfterViewInit, OnDestroy {
 
     @Input() cellTextGenerator: GridCellTextGenerator;
 
+    // If set, appears along the top left side of the grid.
+    @Input() toolbarLabel: string;
+
     context: GridContext;
 
     // These events are emitted from our grid-body component.
@@ -165,6 +168,7 @@ export class GridComponent implements OnInit, AfterViewInit, OnDestroy {
         this.context.rowFlairIsEnabled = this.rowFlairIsEnabled  === true;
         this.context.showDeclaredFieldsOnly = this.showDeclaredFieldsOnly;
         this.context.rowFlairCallback = this.rowFlairCallback;
+        this.context.toolbarLabel = this.toolbarLabel;
         this.context.disablePaging = this.disablePaging === true;
         this.context.cellTextGenerator = this.cellTextGenerator;
         this.context.ignoredFields = [];
index 3c46df8..3b10e0d 100644 (file)
@@ -533,6 +533,7 @@ export class GridContext {
     columnSet: GridColumnSet;
     autoGeneratedColumnOrder: string;
     rowSelector: GridRowSelector;
+    toolbarLabel: string;
     toolbarButtons: GridToolbarButton[];
     toolbarCheckboxes: GridToolbarCheckbox[];
     toolbarActions: GridToolbarAction[];