Possible fix to the problem Jason was getting where xulrunner froze while
authorJoseph Lewis <joehms22@gmail.com>
Thu, 23 Jun 2011 14:57:52 +0000 (08:57 -0600)
committerJoseph Lewis <joehms22@gmail.com>
Thu, 23 Jun 2011 14:57:52 +0000 (08:57 -0600)
running the script for a very large number of rows.

Signed-off-by: Joseph Lewis <joehms22@gmail.com>
Open-ILS/web/js/dojo/openils/widget/AutoGrid.js
Open-ILS/web/templates/default/conify/global/config/circ_matrix_matchpoint.tt2

index 2ef86f6..87342da 100644 (file)
@@ -89,30 +89,32 @@ if(!dojo._hasResource['openils.widget.AutoGrid']) {
                     dojo.place(this.paginator.domNode, this.domNode, 'before');
                     
                     if(this.showBackForward) {
-                        var back = dojo.create('a', {
-                            innerHTML : 'Back',  // TODO i18n
-                            style : 'padding-right:6px;',
-                            href : 'javascript:void(0);', 
-                            onclick : function() { 
-                                self.cachedQueryOpts.offset = self.displayOffset -= self.displayLimit;
-                                if(self.displayOffset < 0)
-                                    self.cachedQueryOpts.offset = self.displayOffset = 0;
-                                self.refresh();
-                            }
-                        });
-
-                        var forw = dojo.create('a', {
-                            innerHTML : 'Next',  // TODO i18n
-                            style : 'padding-right:6px;',
-                            href : 'javascript:void(0);', 
-                            onclick : function() { 
-                                self.cachedQueryOpts.offset = self.displayOffset += self.displayLimit;
-                                self.refresh();
-                            }
-                        });
+                        if(this.displayLimit != null) { //Don't show back or forward if we are displaying all rows.
+                            var back = dojo.create('a', {
+                                innerHTML : 'Back',  // TODO i18n
+                                style : 'padding-right:6px;',
+                                href : 'javascript:void(0);', 
+                                onclick : function() { 
+                                    self.cachedQueryOpts.offset = self.displayOffset -= self.displayLimit;
+                                    if(self.displayOffset < 0)
+                                        self.cachedQueryOpts.offset = self.displayOffset = 0;
+                                    self.refresh();
+                                }
+                            });
+
+                            var forw = dojo.create('a', {
+                                innerHTML : 'Next',  // TODO i18n
+                                style : 'padding-right:6px;',
+                                href : 'javascript:void(0);', 
+                                onclick : function() { 
+                                    self.cachedQueryOpts.offset = self.displayOffset += self.displayLimit;
+                                    self.refresh();
+                                }
+                            });
                         
-                        dojo.place(back, this.paginator.domNode);
-                        dojo.place(forw, this.paginator.domNode);
+                            dojo.place(back, this.paginator.domNode);
+                            dojo.place(forw, this.paginator.domNode);
+                        }
                     }
                     
                     if(this.showLoadFilter) {
@@ -580,10 +582,14 @@ if(!dojo._hasResource['openils.widget.AutoGrid']) {
                 if(this.loadProgressIndicator)
                     dojo.style(this.loadProgressIndicator, 'visibility', 'visible');
                 var self = this;
-                opts = dojo.mixin(
-                    {limit : this.displayLimit, offset : this.displayOffset}, 
-                    opts || {}
-                );
+                
+                if(this.displayLimit != null) {
+                    opts = dojo.mixin(
+                        {limit : this.displayLimit, offset : this.displayOffset}, 
+                        opts || {}
+                    );
+                }
+                
                 opts = dojo.mixin(opts, {
                     async : true,
                     streaming : true,
index 38e95a4..5866e5f 100644 (file)
@@ -20,7 +20,7 @@
             hideSelector='true'
             showBackForward='false'
             showLoadFilter='true'
-            displayLimit='9e15'
+            displayLimit='null'
             columnPickerPrefix='"conify.config.circ_matrix_matchpoint"'>
             <thead>
                 <tr>