LP1904036 Grid toolbarLabel option
authorBill Erickson <berickxx@gmail.com>
Mon, 15 Mar 2021 17:37:24 +0000 (13:37 -0400)
committerBill Erickson <berickxx@gmail.com>
Mon, 5 Apr 2021 14:18:24 +0000 (10:18 -0400)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
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 eb701ce..755f574 100644 (file)
@@ -2,6 +2,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 885a06f..e060870 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 a22e52a..914f92e 100644 (file)
@@ -518,6 +518,7 @@ export class GridContext {
     columnSet: GridColumnSet;
     autoGeneratedColumnOrder: string;
     rowSelector: GridRowSelector;
+    toolbarLabel: string;
     toolbarButtons: GridToolbarButton[];
     toolbarCheckboxes: GridToolbarCheckbox[];
     toolbarActions: GridToolbarAction[];