[open-ils-commits] r10503 - trunk/Open-ILS/web/vandelay

svn at svn.open-ils.org svn at svn.open-ils.org
Tue Sep 2 09:58:46 EDT 2008


Author: erickson
Date: 2008-09-02 09:58:45 -0400 (Tue, 02 Sep 2008)
New Revision: 10503

Modified:
   trunk/Open-ILS/web/vandelay/vandelay.html
   trunk/Open-ILS/web/vandelay/vandelay.js
Log:
using addOnLoad (thanks, dbs).  using atomic version of queued record fetcher to bypass streaming response bug (still not sure what's up with that)

Modified: trunk/Open-ILS/web/vandelay/vandelay.html
===================================================================
--- trunk/Open-ILS/web/vandelay/vandelay.html	2008-09-02 13:56:10 UTC (rev 10502)
+++ trunk/Open-ILS/web/vandelay/vandelay.html	2008-09-02 13:58:45 UTC (rev 10503)
@@ -25,7 +25,7 @@
         <script type="text/javascript" djConfig="parseOnLoad: true,isDebug:false" src="/js/dojo/dojo/dojo.js"></script>
         <script type="text/javascript" src='vandelay.js'></script>
     </head>
-    <body class="tundra" onload='vlInit();'>
+    <body class="tundra" style='height:100%;'>
         <div id="vl-generic-progress" style='width:100%;text-align:center'>
             <div dojoType="dijit.ProgressBar" style="width:200px" indeterminate="true"></div>
         </div>

Modified: trunk/Open-ILS/web/vandelay/vandelay.js
===================================================================
--- trunk/Open-ILS/web/vandelay/vandelay.js	2008-09-02 13:56:10 UTC (rev 10502)
+++ trunk/Open-ILS/web/vandelay/vandelay.js	2008-09-02 13:58:45 UTC (rev 10503)
@@ -166,9 +166,10 @@
 
 function retrieveQueuedRecords(type, queueId, onload) {
     fieldmapper.standardRequest(
-        ['open-ils.vandelay', 'open-ils.vandelay.'+type+'_queue.records.retrieve'],
+        ['open-ils.vandelay', 'open-ils.vandelay.'+type+'_queue.records.retrieve.atomic'],
         {   async: true,
             params: [authtoken, queueId, {clear_marc:1}],
+            /* intermittent bug in streaming, multipart requests prevents use of onreponse for now...
             onresponse: function(r) {
                 var rec = r.recv().content();
                 if(e = openils.Event.parse(rec))
@@ -176,7 +177,18 @@
                 queuedRecords.push(rec);
                 queuedRecordsMap[rec.id()] = rec;
             },
-            oncomplete: function(){onload();}
+            */
+            oncomplete: function(r){
+                var recs = r.recv().content();
+                if(e = openils.Event.parse(recs))
+                    return alert(e);
+                for(var i = 0; i < recs.length; i++) {
+                    var rec = recs[i];
+                    queuedRecords.push(rec);
+                    queuedRecordsMap[rec.id()] = rec;
+                }
+                onload();
+            }
         }
     );
 }
@@ -201,9 +213,9 @@
 
     /* test structure... */
     var structure = [{
-        noscroll : true,
+        //noscroll : true,
         cells : [[
-            {name: 'ID', field: 'id'},
+            //{name: 'ID', field: 'id'},
         ]]
     }];
 
@@ -211,11 +223,13 @@
     for(var i = 0; i < defs.length; i++) {
         var attr = defs[i]
         attrMap[attr.code()] = attr.id();
-        structure[0].cells[0].push({
+        var col = {
             name:attr.description(), 
             field:'attr.' + attr.code(),
             get: getAttrValue
-        });
+        };
+        if(attr.code().match(/title/i)) col.width = 'auto'; // this is hack.
+        structure[0].cells[0].push(col);
     }
 
     vlQueueGrid.setStructure(structure);
@@ -263,3 +277,5 @@
 
     createQueue(queueName, currentType, handleCreateQueue);
 }
+
+dojo.addOnLoad(vlInit);



More information about the open-ils-commits mailing list