- [% IF ( CircAutocompl ) %]
- function create_auto_completion_responder(uniqueid,attrcode) {
- YAHOO.util.Event.onContentReady("pattrodue-getready-"+uniqueid, function() {
- new function() {
- // Define a custom formatter function
- this.fnCustomFormatter = function(oResultItem, sQuery) {
- var description = oResultItem[0];
- var authorised_value = oResultItem[1];
- var aMarkup = [
- "<div class='pattrodue-result'>",
- description,
- " (",
- authorised_value,
- ")",
- "</div>"];
- return (aMarkup.join(""));
- };
-
- // Instantiate an XHR DataSource
- this.oACDS = new YAHOO.widget.DS_XHR("/cgi-bin/koha/circ/ypattrodue-attr-search-authvalue.pl/"+attrcode, ["\n", "\t"]);
- this.oACDS.responseType = YAHOO.widget.DS_XHR.TYPE_FLAT;
- this.oACDS.maxCacheEntries = 60;
- this.oACDS.queryMatchSubset = true;