[open-ils-commits] r18785 - trunk/Open-ILS/web/js/dojo/openils/widget (gmc)

svn at svn.open-ils.org svn at svn.open-ils.org
Thu Nov 18 11:28:23 EST 2010


Author: gmc
Date: 2010-11-18 11:28:21 -0500 (Thu, 18 Nov 2010)
New Revision: 18785

Modified:
   trunk/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js
Log:
use pcrud auto-complete widget when selecting providers

Fixes general slowness working with invoice and PO forms if
more than a couple hundred providers are defined.

This could be generalized with a bit of work with Fieldmapper
to define "has-one-chosen-by-user-from-cast-of-thousands"
relationships that should trigger use the auto-complete widget.

Signed-off-by: Galen Charlton <gmc at esilibrary.com>

Modified: trunk/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js
===================================================================
--- trunk/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js	2010-11-18 16:28:19 UTC (rev 18784)
+++ trunk/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js	2010-11-18 16:28:21 UTC (rev 18785)
@@ -405,6 +405,8 @@
                 return this._buildOrgSelector();
             if(linkClass == 'acpl')
                 return this._buildCopyLocSelector();
+            if(linkClass == 'acqpro')
+                return this._buildAutoCompleteSelector(linkClass, vfield.selector);
 
 
             dojo.require('dojo.data.ItemFileReadStore');
@@ -651,6 +653,17 @@
             });
 
             return true;
+        },
+
+        _buildAutoCompleteSelector : function(linkClass, searchAttr) {
+            dojo.require("openils.widget.PCrudAutocompleteBox");
+            dojo.mixin(this.dijitArgs, {
+                fmclass : linkClass,
+                searchAttr : searchAttr,
+            });
+            this.widget = new openils.widget.PCrudAutocompleteBox(this.dijitArgs, this.parentNode);
+            this._widgetLoaded();
+            return true;
         }
     });
 



More information about the open-ils-commits mailing list