1 if (!dojo._hasResource["openils.widget.PCrudAutocompleteBox"]) {
2 dojo._hasResource["openils.widget.PCrudAutocompleteBox"] = true;
3 dojo.provide("openils.widget.PCrudAutocompleteBox");
5 dojo.require("openils.PermaCrud.Store");
6 dojo.require("dijit.form.FilteringSelect");
9 "openils.widget.PCrudAutocompleteBox", [dijit.form.FilteringSelect], {
11 // An autocompleting textbox that uses PermaCrud to fetch
12 // matches. openils.PermaCrud.Store does the work.
15 // Use just like a dijit.form.FilteringSelect except that there
16 // are these additional properties supported in the args object:
18 // The *fmclass* parameter.
19 // The class hint for the kind of fieldmapper object you
20 // want to work with. From the IDL.
22 // The *store_options* parameter.
23 // Another object of options such as you would pass to
24 // openils.PermaCrud.Store. See the documentation for that
25 // class (it's more thorough).
27 // You should also use the existing *searchAttr* object to
28 // specify what you want to search for as you type and what
29 // you see in the box.
34 "constructor": function(args) {
35 if (!args.hasDownArrow)
36 args.hasDownArrow = false;
40 throw new Error("need either store or fmclass");
41 var store_options = dojo.mixin(
42 {"fmclass": args.fmclass}, args.store_options
44 args.store = new openils.PermaCrud.Store(store_options);