lp1993824: grids bug fix; disabled attribute on eg-grid-toolbar-action
authorJason Etheridge <jason@EquinoxOLI.org>
Sun, 5 Mar 2023 18:40:31 +0000 (13:40 -0500)
committerJason Etheridge <phasefx@gmail.com>
Sun, 14 May 2023 13:02:33 +0000 (09:02 -0400)
Signed-off-by: Jason Etheridge <jason@EquinoxOLI.org>
Open-ILS/src/eg2/src/app/share/grid/grid-toolbar-action.component.ts
Open-ILS/src/eg2/src/app/share/grid/grid-toolbar-actions-menu.component.ts

index 6982525..213e150 100644 (file)
@@ -24,7 +24,9 @@ export class GridToolbarActionComponent implements OnInit {
     @Input() action: (rows: any[]) => any;
 
     @Input() set disabled(d: boolean) {
-        this.toolbarAction.disabled = d;
+        if (this.toolbarAction) {
+            this.toolbarAction.disabled = d;
+        }
     }
     get disabled(): boolean {
         return this.toolbarAction.disabled;
index 87f4c2c..a5a578e 100644 (file)
@@ -27,6 +27,9 @@ export class GridToolbarActionsMenuComponent {
     }
 
     shouldDisable(action: GridToolbarAction): boolean {
+        if (action.disabled) {
+            return true;
+        }
         if (action.disableOnRows) {
             return action.disableOnRows(this.gridContext.getSelectedRows());
         }