Reputation:
Just wondering what a decent approach would be to managing thousands of items in a dropdown (from a database). Speaking on my particular issue, the query to obtain this data is quite expensive, and I'd rather not query the data unnecessarily. This tells me ajax dropdown is probably not the best idea.
What would you do? Cache the data, and query that using ajax?
Upvotes: 0
Views: 162
Reputation: 39777
Probably dropdown is not such a good idea in such case. Perhaps a grid with paging?
If you absolutely must to use dropdown - cache the query results (in a table on the DB side if result set is too big or in-memory cache on Web server otherwise) and use a drop down that supports typeahed, so when user types a few characters - only relevant relevant records are displayed.
Upvotes: 1