Skip to content

Instantly share code, notes, and snippets.

@brianjmiller
Created June 9, 2011 18:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brianjmiller/1017449 to your computer and use it in GitHub Desktop.
Save brianjmiller/1017449 to your computer and use it in GitHub Desktop.
YUI AC with function as requestTemplate
// Y.IC.AutoComplete source: https://github.com/Wiggins/interchange_mvc/blob/master/share/ic/js/autocomplete.js
return new Y.IC.AutoComplete (
{
inputNode: input_node,
queryDelay: 300,
minQueryLength: 6,
resultListLocator: "results",
source: "/manage/LogisticsZoneServiceMaps/ac?_format=json&service_kind=delivery&",
requestTemplate: function (query) {
var my_result = 'code=' + query;
return my_result;
}
}
);
// resulting url: /manage/LogisticsZoneServiceMaps/ac?_format=json&service_kind=delivery&code=code=NW8%209AY
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment