issa-tseng / awesomecomplete

A lightweight autocomplete plugin for jQuery. Autocomplete that doesn't suck — I think.
http://dontexplain.com/2009/08/jquery-plugin-lautocomplete/
52 stars 7 forks source link

Asynchronous call to get data? #1

Closed ezanker closed 14 years ago

ezanker commented 14 years ago

Is it possible to retrieve the data asynchronously via AJAX call?

issa-tseng commented 14 years ago

Yes, though it's not as well-tested a code path as static data. Take a look at dataMethod in the documentation: http://wiki.github.com/clint-tseng/Awesomecomplete/

After you have your data you'll want to call awesomecomplete_onData(data, term) on the jQuery object of your Awesomecomplete.

ezanker commented 14 years ago

Thanks for the quick response. I did not see the awesomecomplete_onData(data, term) part in the documentation.

issa-tseng commented 14 years ago

Yeah; I'm going to change how that part of the API works slightly in the next iteration anyway or I'd have added it just now.