[open-ils-commits] r18787 - branches/rel_2_0/Open-ILS/web/js/dojo/openils/widget (gmc)

svn at svn.open-ils.org svn at svn.open-ils.org
Thu Nov 18 11:31:39 EST 2010


Author: gmc
Date: 2010-11-18 11:31:36 -0500 (Thu, 18 Nov 2010)
New Revision: 18787

Modified:
   branches/rel_2_0/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: branches/rel_2_0/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js
===================================================================
--- branches/rel_2_0/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js	2010-11-18 16:31:34 UTC (rev 18786)
+++ branches/rel_2_0/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js	2010-11-18 16:31:36 UTC (rev 18787)
@@ -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