[open-ils-commits] r11801 - trunk/Open-ILS/web/js/dojo/openils/widget

svn at svn.open-ils.org svn at svn.open-ils.org
Mon Jan 12 13:07:02 EST 2009


Author: erickson
Date: 2009-01-12 13:06:59 -0500 (Mon, 12 Jan 2009)
New Revision: 11801

Modified:
   trunk/Open-ILS/web/js/dojo/openils/widget/EditPane.js
Log:
plugged in initial support for performing edit operations on the server

Modified: trunk/Open-ILS/web/js/dojo/openils/widget/EditPane.js
===================================================================
--- trunk/Open-ILS/web/js/dojo/openils/widget/EditPane.js	2009-01-12 18:06:34 UTC (rev 11800)
+++ trunk/Open-ILS/web/js/dojo/openils/widget/EditPane.js	2009-01-12 18:06:59 UTC (rev 11801)
@@ -6,6 +6,7 @@
     dojo.require('openils.Util');
     dojo.require('openils.User');
     dojo.require('fieldmapper.IDL');
+    dojo.require('openils.PermaCrud');
 
     dojo.declare(
         'openils.widget.EditPane',
@@ -124,6 +125,24 @@
                         }
                     );
                 } 
+            },
+
+            performEditAction : function(opts) {
+
+                var pcrud = new openils.PermaCrud();
+                var fields = this.getFields();
+                for(var idx in fields) 
+                    this.fmObject[fields[idx]](this.getFieldValue(fields[idx]));
+
+                if(opts.async) {
+                    opts.oncomplete = function(r) {
+                        pcrud.disconnect()
+                        opts.oncomplete(r);
+                    };
+                }
+
+                pcrud[this.mode](this.fmObject, opts);
+                if(!opts.async) pcrud.disconnect();
             }
         }
     );



More information about the open-ils-commits mailing list