LP#1775466 Grid cell vertical expand option
authorBill Erickson <berickxx@gmail.com>
Tue, 10 Jul 2018 15:24:03 +0000 (11:24 -0400)
committerBill Erickson <berickxx@gmail.com>
Wed, 5 Sep 2018 14:05:23 +0000 (10:05 -0400)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/eg2/src/app/share/grid/grid-body.component.html
Open-ILS/src/eg2/src/app/share/grid/grid-toolbar.component.html
Open-ILS/src/eg2/src/app/share/grid/grid.component.css
Open-ILS/src/eg2/src/app/share/grid/grid.ts

index 3979c81..b7284fe 100644 (file)
@@ -26,6 +26,7 @@
       </ng-container>
     </div>
     <div class="eg-grid-cell eg-grid-body-cell" [ngStyle]="{flex:col.flex}"
+      [ngClass]="{'eg-grid-cell-overflow': context.overflowCells}"
       (dblclick)="onRowDblClick(row)"
       (click)="onRowClick($event, row, idx)"
       *ngFor="let col of context.columnSet.displayColumns()">
index d148b20..005bd80 100644 (file)
         <span class="ml-2" i18n>Manage Column Widths</span>
       </a>
       <a class="dropdown-item label-with-material-icon" 
+        (click)="gridContext.overflowCells = !gridContext.overflowCells">
+        <ng-container *ngIf="!gridContext.overflowCells">
+          <span class="material-icons">keyboard_arrow_down</span>
+          <span class="ml-2" i18n>Expand Cells Vertically</span>
+        </ng-container>
+        <ng-container *ngIf="gridContext.overflowCells">
+          <span class="material-icons">keyboard_arrow_up</span>
+          <span class="ml-2" i18n>Shrink Cells Vertically</span>
+        </ng-container>
+      </a>
+      <a class="dropdown-item label-with-material-icon" 
         (click)="saveColumns()">
         <span class="material-icons">save</span>
         <span class="ml-2" i18n>Save Columns</span>
index 391df80..ecf305c 100644 (file)
     overflow: hidden;
 }
 
+.eg-grid-cell-overflow {
+    white-space: normal;
+    text-overflow: inherit;
+    overflow: inherit;
+}
+
 .eg-grid-body-cell {
 }
 
index feaa374..bed200c 100644 (file)
@@ -350,6 +350,7 @@ export class GridContext {
     rowClassCallback: (row: any) => string;
     cellClassCallback: (row: any, col: GridColumn) => string;
     defaultHiddenFields: string[];
+    overflowCells: boolean;
 
     // Services injected by our grid component
     idl: IdlService;