[open-ils-commits] r15546 - in trunk/Open-ILS/web/js: dojo/openils/widget ui/default/acq/common (senator)
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue Feb 16 10:11:39 EST 2010
Author: senator
Date: 2010-02-16 10:11:37 -0500 (Tue, 16 Feb 2010)
New Revision: 15546
Modified:
trunk/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js
trunk/Open-ILS/web/js/ui/default/acq/common/li_table.js
Log:
Acq: POs can only be created with active providers (vendors)
Added a new feature to AutoFieldWidget to make this as simple: there's now
a searchFilter option that you can give to the constructor, enabling you
to constrain the set of objects that you'll get back for, say, a
FilteringSelect widget.
Modified: trunk/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js
===================================================================
--- trunk/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js 2010-02-16 15:00:34 UTC (rev 15545)
+++ trunk/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js 2010-02-16 15:11:37 UTC (rev 15546)
@@ -385,13 +385,18 @@
oncomplete();
} else {
- new openils.PermaCrud().retrieveAll(linkClass, {
- async : !this.forceSync,
- oncomplete : function(r) {
- var list = openils.Util.readResponse(r, false, true);
- oncomplete(list);
- }
- });
+ var _cb = function(r) {
+ oncomplete(openils.Util.readResponse(r, false, true));
+ };
+ if (this.searchFilter) {
+ new openils.PermaCrud().search(linkClass, this.searchFilter, {
+ async : !this.forceSync, oncomplete : _cb
+ });
+ } else {
+ new openils.PermaCrud().retrieveAll(linkClass, {
+ async : !this.forceSync, oncomplete : _cb
+ });
+ }
}
return true;
Modified: trunk/Open-ILS/web/js/ui/default/acq/common/li_table.js
===================================================================
--- trunk/Open-ILS/web/js/ui/default/acq/common/li_table.js 2010-02-16 15:00:34 UTC (rev 15545)
+++ trunk/Open-ILS/web/js/ui/default/acq/common/li_table.js 2010-02-16 15:11:37 UTC (rev 15546)
@@ -973,6 +973,7 @@
var widget = new openils.widget.AutoFieldWidget({
fmField : 'provider',
fmClass : 'acqpo',
+ searchFilter: {"active": "t"},
parentNode : dojo.byId('acq-lit-po-provider'),
});
widget.build(
More information about the open-ils-commits
mailing list