Emmett
Emmett

Reputation: 14327

Custom search function for jQuery UI Autocomplete

I'm using jQuery UI Autocomplete.

Is there a way to override its default search algorithm?

The changes I want to make are:

Upvotes: 5

Views: 6189

Answers (1)

Nikita Rybak
Nikita Rybak

Reputation: 68006

Normally, it all should be done in back-end. Your server-side script defines in what order and how many results will be returned.

Alternatively (if back-end is not under your control), you can specify function as source attribute. In this function you can query back-end and process results in whatever way your want. E.g., here's an example
http://jqueryui.com/demos/autocomplete/#multiple-remote

Upvotes: 2

Related Questions