cleaned up to match latest autogrid
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 5 Feb 2009 04:48:35 +0000 (04:48 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 5 Feb 2009 04:48:35 +0000 (04:48 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@12074 dcc99617-32d9-48b4-a31d-7c20da2025e4

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

index 68ec3a5..2d3a52c 100644 (file)
@@ -5,37 +5,27 @@
 <h1>Exchange Rates</h1><br/>
 
 <script>
-    dojo.require('dojo.data.ItemFileWriteStore');
-    dojo.require('openils.widget.EditDialog');
     dojo.require('openils.widget.AutoGrid');
     dojo.require('openils.PermaCrud');
     dojo.require('openils.Util');
-    dojo.require('dojox.grid.DataGrid');
-
-    var cache = {};
     function renderGrid() {
-        erGrid.storeItemObjectMapper = function(item) { return cache[item.id]; };
         var pcrud = new openils.PermaCrud();
         pcrud.retrieveAll('acqexr', 
             {   async : true,
-                oncomplete : function(r) {
-                    var list = openils.Util.readResponse(r);
-                    erGrid.fmObjectList = list;
-                    for(var i in list) {
-                        cache[list[i].id()] = list[i];
-                        erGrid.store.newItem(list[i].toStoreItem());
-                    }
+                streaming : true,
+                onresponse : function(r) {
+                    var item = openils.Util.readResponse(r);
+                    erGrid.store.newItem(item.toStoreItem());
                     erGrid.update();
-                }
+               }     
             }
         );
     }
     openils.Util.addOnLoad(renderGrid);
 </script>
-
 <div dojoType="dijit.layout.ContentPane" layoutAlign="top" style='height:600px;'>
-    <table jsId="erGrid" dojoType="openils.widget.AutoGrid" class='editable-auto-grid'
-            fieldOrder="['id', 'from_currency', 'to_currency', 'ratio']"
+    <table jsId="erGrid" dojoType="openils.widget.AutoGrid" 
+            fieldOrder="['id', 'from_currency', 'to_currency', 'ratio']" 
             query="{id: '*'}" rowSelector='20px' fmClass='acqexr' editOnEnter='true'>
     </table>
 </div>