Skip to content

Instantly share code, notes, and snippets.

@ZenCocoon
Created September 12, 2010 20:25
Show Gist options
  • Select an option

  • Save ZenCocoon/576413 to your computer and use it in GitHub Desktop.

Select an option

Save ZenCocoon/576413 to your computer and use it in GitHub Desktop.
new Ajax.request(YOUR_URL_HERE, {
method: 'get',
onSuccess: function(response) {
new S2.UI.Autocompleter('autocompleter2', {
choices: response.responseJSON.map(function(o) { return o.client }),
choiceAttribute: 'name',
listTemplate: new Template('#{text} <em>(#{object.login})</em>')
},
onFailure: function(response) {
// Handle failure here
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment