use built-in edit dialog
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 4 Feb 2009 18:41:44 +0000 (18:41 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 4 Feb 2009 18:41:44 +0000 (18:41 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@12065 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/templates/default/conify/global/acq/exchange_rate.tt2

index 5a179f0..68ec3a5 100644 (file)
@@ -14,6 +14,7 @@
 
     var cache = {};
     function renderGrid() {
+        erGrid.storeItemObjectMapper = function(item) { return cache[item.id]; };
         var pcrud = new openils.PermaCrud();
         pcrud.retrieveAll('acqexr', 
             {   async : true,
         );
     }
     openils.Util.addOnLoad(renderGrid);
-
-    openils.Util.addOnLoad(function() {
-        dojo.connect(erGrid, 'onKeyDown',
-            function(e) {
-                if(e.keyCode == dojo.keys.ENTER) {
-                    this.selection.deselectAll();
-                    this.selection.select(this.focus.rowIndex);
-                    var item = this.selection.getFirstSelected();
-                    var dialog = new openils.widget.EditDialog({
-                        fmObject:cache[item.id],
-                        onPostApply : function() {
-                            // update grid item object
-                        }
-                    });
-                    dialog.editPane.fieldOrder = erGrid.fieldOrder;
-                    dialog.startup();
-                    dialog.show();
-                }
-            }
-        );
-    });
-
 </script>
 
 <div dojoType="dijit.layout.ContentPane" layoutAlign="top" style='height:600px;'>
-    <table jsId="erGrid" dojoType="openils.widget.AutoGrid" 
+    <table jsId="erGrid" dojoType="openils.widget.AutoGrid" class='editable-auto-grid'
             fieldOrder="['id', 'from_currency', 'to_currency', 'ratio']"
-            query="{id: '*'}" rowSelector='20px' fmClass='acqexr'>
+            query="{id: '*'}" rowSelector='20px' fmClass='acqexr' editOnEnter='true'>
     </table>
 </div>
 [% END %]