LP#1712854 - make hold grids set grid.totalCount user/cesardv/collab_lp1712854_clientsort_hold_grids
authorCesar Velez <cesar.velez@equinoxinitiative.org>
Fri, 12 Jan 2018 17:18:31 +0000 (12:18 -0500)
committerCesar Velez <cesar.velez@equinoxinitiative.org>
Fri, 12 Jan 2018 17:18:31 +0000 (12:18 -0500)
Since we are pre-fetching all holds for these grids, we know
the totalCount and thus we can make the grid behave better.
Avoid the weirdness described in bug 1739648, which this patch
depends on.

Signed-off by: Cesar Velez <cesar.velez@equinoxinitiative.org>

Open-ILS/web/js/ui/default/staff/cat/catalog/app.js
Open-ILS/web/js/ui/default/staff/circ/holds/app.js

index b63e9cb..63d17c5 100644 (file)
@@ -1681,12 +1681,13 @@ function($scope , $routeParams , $location , $window , $q , egCore , egHolds , e
                     hold_ids = hold_ids.concat(list);
                 });
 
+                $scope.hold_grid_data_provider.grid.totalCount = hold_ids.length;
+                
                 // Set the max value of the progress bar to the lesser of
                 // the total number of holds to fetch or the page size
                 // of the grid.
                 egProgressDialog.update(
                     {max : hold_ids.length});
-
                 var holds_fetched = 0;
                 fetchHolds().then(deferred.resolve, null, 
                     function(hold_data) {
index f48bfa6..c21dac7 100644 (file)
@@ -100,6 +100,7 @@ function($scope , $q , $routeParams , $window , $location , egCore , egHolds , e
             }
 
             hold_ids = ids;
+            $scope.gridDataProvider.grid.totalCount = hold_ids.length;
             egProgressDialog.update(
                 {max : hold_ids.length});