for now, let's slow things down and flesh one row at a time.. paging interface is...
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 17 Mar 2006 15:33:00 +0000 (15:33 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 17 Mar 2006 15:33:00 +0000 (15:33 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@3385 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/server/patron/search_result.js

index 6170879..2c34765 100644 (file)
@@ -92,6 +92,7 @@ patron.search_result.prototype = {
        },
 
        'search' : function(query) {
        },
 
        'search' : function(query) {
+               var obj = this;
                var search_hash = {};
                for (var i in query) {
                        switch( i ) {
                var search_hash = {};
                for (var i in query) {
                        switch( i ) {
@@ -123,11 +124,24 @@ patron.search_result.prototype = {
                                api.FM_AU_IDS_RETRIEVE_VIA_HASH.method,
                                [ this.session, search_hash ]
                        );
                                api.FM_AU_IDS_RETRIEVE_VIA_HASH.method,
                                [ this.session, search_hash ]
                        );
+                       //this.list.append( { 'retrieve_id' : results[i], 'row' : {} } );
+                       var funcs = [];
+
+                               function gen_func(r) {
+                                       return function() {
+                                               obj.list.append( { 'retrieve_id' : r, 'row' : {} } );
+                                       }
+                               }
+
                        for (var i = 0; i < results.length; i++) {
                        for (var i = 0; i < results.length; i++) {
-                               this.list.append( { 'retrieve_id' : results[i], 'row' : {} } );
+                               funcs.push( gen_func(results[i]) );
                        }
                        }
+                       JSAN.use('util.exec'); var exec = new util.exec();
+                       exec.chain( funcs );
+
                } catch(E) {
                        this.error.sdump('D_ERROR','patron.search_result.search: ' + js2JSON(E));
                } catch(E) {
                        this.error.sdump('D_ERROR','patron.search_result.search: ' + js2JSON(E));
+                       alert(E);
                }
        }
 
                }
        }