[open-ils-commits] r13946 - branches/rel_1_6/Open-ILS/web/js/dojo/openils/widget (erickson)

svn at svn.open-ils.org svn at svn.open-ils.org
Tue Sep 1 16:56:00 EDT 2009


Author: erickson
Date: 2009-09-01 16:55:54 -0400 (Tue, 01 Sep 2009)
New Revision: 13946

Modified:
   branches/rel_1_6/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js
Log:
use a separate pcrud instance for each object deletion so that a single instances isn't trying to create transactions while it's already in the middle of transactions, pending async responses.  added some docs

Modified: branches/rel_1_6/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js
===================================================================
--- branches/rel_1_6/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js	2009-09-01 20:54:29 UTC (rev 13945)
+++ branches/rel_1_6/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js	2009-09-01 20:55:54 UTC (rev 13946)
@@ -286,6 +286,9 @@
                 }
             },
 
+            /**
+             * @return {Array} List of every fieldmapper object in the data store
+             */
             getAllObjects : function() {
                 var objs = [];
                 var self = this;
@@ -301,16 +304,18 @@
                 return objs;
             },
 
+            /**
+             * Deletes the underlying object for all selected rows
+             */
             deleteSelected : function() {
                 var items = this.getSelectedItems();
                 var total = items.length;
                 var self = this;
                 dojo.require('openils.PermaCrud');
-                var pcrud = new openils.PermaCrud();
                 dojo.forEach(items,
                     function(item) {
                         var fmObject = new fieldmapper[self.fmClass]().fromStoreItem(item);
-                        pcrud['delete'](fmObject, {oncomplete : function(r) { self.store.deleteItem(item) }});
+                        new openils.PermaCrud()['delete'](fmObject, {oncomplete : function(r) { self.store.deleteItem(item) }});
                     }
                 );
             },
@@ -468,6 +473,9 @@
                 this.editDialog.show();
             },
 
+            /**
+             * Generates an EditDialog for object creation and displays it to the user
+             */
             showCreateDialog : function() {
                 var self = this;
                 var done = function() { self.hideDialog(); };



More information about the open-ils-commits mailing list