From e364f2124b13959d96af505200eabdf7823bedbb Mon Sep 17 00:00:00 2001 From: Jason Etheridge Date: Sun, 5 Mar 2023 13:40:31 -0500 Subject: [PATCH] lp1993824: grids bug fix; disabled attribute on eg-grid-toolbar-action Signed-off-by: Jason Etheridge --- Open-ILS/src/eg2/src/app/share/grid/grid-toolbar-action.component.ts | 4 +++- .../src/eg2/src/app/share/grid/grid-toolbar-actions-menu.component.ts | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/eg2/src/app/share/grid/grid-toolbar-action.component.ts b/Open-ILS/src/eg2/src/app/share/grid/grid-toolbar-action.component.ts index 6982525527..213e150b75 100644 --- a/Open-ILS/src/eg2/src/app/share/grid/grid-toolbar-action.component.ts +++ b/Open-ILS/src/eg2/src/app/share/grid/grid-toolbar-action.component.ts @@ -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; diff --git a/Open-ILS/src/eg2/src/app/share/grid/grid-toolbar-actions-menu.component.ts b/Open-ILS/src/eg2/src/app/share/grid/grid-toolbar-actions-menu.component.ts index 87f4c2c240..a5a578e42d 100644 --- a/Open-ILS/src/eg2/src/app/share/grid/grid-toolbar-actions-menu.component.ts +++ b/Open-ILS/src/eg2/src/app/share/grid/grid-toolbar-actions-menu.component.ts @@ -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()); } -- 2.11.0