use new built-in autogrid fetch & load
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sun, 8 Feb 2009 16:06:36 +0000 (16:06 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sun, 8 Feb 2009 16:06:36 +0000 (16:06 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@12110 dcc99617-32d9-48b4-a31d-7c20da2025e4

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

index bbf1c0a..e6468f8 100644 (file)
@@ -1,31 +1,16 @@
 [% WRAPPER default/base.tt2 %]
-<!--
-<script src='[% ctx.media_prefix %]/js/ui/default/conify/global/config/billing_type.js'> </script>
--->
-
 <script>
     dojo.require('openils.widget.AutoGrid');
-    dojo.require('openils.PermaCrud');
-    dojo.require('openils.Util');
-    function renderGrid() {
-        var pcrud = new openils.PermaCrud();
-        pcrud.retrieveAll('acqexr', 
-            {   async : true,
-                streaming : true,
-                onresponse : function(r) {
-                    var item = openils.Util.readResponse(r);
-                    erGrid.store.newItem(item.toStoreItem());
-               }     
-            }
-        );
-    }
-    openils.Util.addOnLoad(renderGrid);
+    openils.Util.addOnLoad(
+        function() { 
+            erGrid.loadAll({order_by:{acqpro : 'name'}}); 
+        }
+    );
 </script>
 <div dojoType="dijit.layout.ContentPane" layoutAlign="top" class='oils-header-panel'>
     <div>Exchange Rates</div>
     <div><button dojoType='dijit.form.Button' onClick='erGrid.showCreateDialog()'>New</button></div>
 </div>
-
 <div dojoType="dijit.layout.ContentPane" layoutAlign="client" style='height:600px;'>
     <table jsId="erGrid" dojoType="openils.widget.AutoGrid" 
             fieldOrder="['id', 'from_currency', 'to_currency', 'ratio']" defaultCellWidth='12'