dave walker
dave walker

Reputation: 3108

Creating a dynamic selection list with content from the server

I would like to achieve an effect similar to the 'Tags' input field of this web site where the user inputs some text and then is presented with options from the data store (assuming SO does not cache all tags on the client).

My current plan is to use something like the Chosen JavaScript plugin (http://harvesthq.github.io/chosen/) and bind the select element's options to an observable array containing the search results from the user input. So I would do the server query on two or three characters and let the JavaScript plugin do the filtering.

Is there any reason this won't work? Is there a simpler way to do it? Is there some sample code somewhere that I can use?

Upvotes: 3

Views: 190

Answers (1)

techsaint
techsaint

Reputation: 772

There is no reason why this wouldn't work. Check out the throttle extender information from the knockoutjs website. It has some tips to get the best performance out of knockout when doing repeated user requested ajax calls.

Upvotes: 1

Related Questions