grid cleanup / docs cont.
authorBill Erickson <berick@esilibrary.com>
Tue, 29 Apr 2014 21:07:22 +0000 (17:07 -0400)
committerBill Erickson <berick@esilibrary.com>
Tue, 29 Apr 2014 21:07:22 +0000 (17:07 -0400)
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/web/js/ui/default/staff/circ/patron/checkout.js
Open-ILS/web/js/ui/default/staff/services/grid.js

index 9100acc..8351407 100644 (file)
@@ -26,12 +26,13 @@ function($scope,  $q,  $modal,  $routeParams,  egNet,  egAuth,  egUser,
     provider.itemFieldValue = function(item, column) {
         return provider.nestedItemFieldValue(item, column);
     };
-    $scope.gridDataProvider = provider;
 
     function addCheckout(co) {
         $scope.checkouts.push(co);
-        $scope.gridDataProvider.increment();
+        provider.increment();
     }
+
+    $scope.gridDataProvider = provider;
     // -----------------------------
 
     $scope.selectedNcType = function() {
index 6203b7b..0d86cdb 100644 (file)
@@ -29,6 +29,21 @@ angular.module('egGridMod',
             idField : '@',
 
             // Reference to externally provided egGridDataProvider
+            // BEWARE: the grid removes everything from its scope that
+            // is not needed within the template.  "=" sets up a two-way
+            // binding between the grid and the calling scope.  After
+            // grid initiation, the itemsProvider attribute within the 
+            // shared scope space will be set to undefined.  
+            //
+            // In other words:
+            //
+            // template   => items-provider="myProvider"
+            //
+            // controller => $scope.myProvider === undefined
+            //
+            // Storing the provider in the local scope just hogs 
+            // resources, anyway.
+            //
             itemsProvider : '=',
 
             // comma-separated list of supported or disabled grid features