LP1642036 Group member detail grid query repair
authorBill Erickson <berickxx@gmail.com>
Wed, 24 Apr 2019 13:19:40 +0000 (09:19 -0400)
committerJason Stephenson <jason@sigio.com>
Thu, 25 Apr 2019 17:51:26 +0000 (13:51 -0400)
Teach the grid to automatically use the current version of the grid
query in group member details lookup, since the query changes as
patron's change and is sometimes applied after the grid has already
absorbed the setQuery function.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: John Amundson <jamundson@cwmars.org>
Signed-off-by: Jason Stephenson <jason@sigio.com>
Open-ILS/web/js/ui/default/staff/circ/patron/app.js

index d007257..a886195 100644 (file)
@@ -1066,6 +1066,15 @@ function($scope,  $routeParams , $q , $window , $timeout,  $location , egCore ,
         },
         setSort : function() {
             return ['create_date'];
         },
         setSort : function() {
             return ['create_date'];
+        },
+        watchQuery: function() {
+            if (patronSvc.current) {
+                return {
+                    usrgroup : patronSvc.current.usrgroup(),
+                    deleted : 'f'
+                };
+            }
+            return null;
         }
     }
 
         }
     }
 
@@ -1075,11 +1084,6 @@ function($scope,  $routeParams , $q , $window , $timeout,  $location , egCore ,
         // grid query.
         if (redirect) return;
         // let initTab() fetch the user first so we can know the usrgroup
         // grid query.
         if (redirect) return;
         // let initTab() fetch the user first so we can know the usrgroup
-
-        grid.setQuery({
-            usrgroup : patronSvc.current.usrgroup(),
-            deleted : 'f'
-        });
         $scope.totals.owed = patronSvc.patron_stats.fines.group_balance_owed;
     });
 
         $scope.totals.owed = patronSvc.patron_stats.fines.group_balance_owed;
     });