jQuery Auto complete dropdown box
After almost two days of searching and R&D finally I've derived some of the following jQuery based auto-complete plugins which I find worth and suitable for my web-app.
I've an MVC2 based web-app that I'm developing in ASP.Net C#. I've L2S (LINQ to SQL) as my DAL and I use service layer architecture to fetch data via the L2S.
Now, I'm going to have some "Look ups" in which the list of selection might be big (i.e. 1000 or more records) so at times I want my auto-complete look up to be dynamic (i.e. I give the page from which it'll get the values and show in the dropdown) But there're simple ones also like 10-20 values which I want to render statically.
In short I need something v.simple and straight forward auto-complete plugin which does the job without asking me too many questions or requiring too many .js files (of course excluding jQuery).
Here's the summary of my R&D along with my conclusion -
- Simpler, static, has contains search( http://frontensemble.com/hyjack/)
- Simple, static/dynamic, only starts with search( http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/)
- Complex, static/dynamic, combobox like contains search and much more ( http://jqueryui.com/demos/autocomplete/ http://docs.jquery.com/UI/Autocomplete/ )
- Simpler, static/dynamic, has contains search ( http://www.dyve.net/jquery?autocomplete )
*Pls consider the (dot) above as my ratings. After some insights and demo reviews I've concluded that I'll go with #4 the dyve.net auto-complete plugin because it seems to be doing everything I need and most importantly its not complex.
You'll find that #3 is rich in functionality and has much more but its big and gets complex so I've to opt it. FYI, #2 is nothing more but the primary version of #3 (but the only problem I faced is that it (#2) only has starts-with match, contains match is much better)
Hope I'm on track.
EDIT:
Well after a night-out and more then 20 hours of struggling and experimenting. I conclude that with jQuery I need to choose something which has a bigger support. With option #4 -The main problem came in when I wanted to populate a child dropdown based on parent It does populate dynamically but it persists the old items as well so while sea开发者_如何学Gorching - the old ones will popup! I tried its cacheFlush, etc.. but it didn't worked. Finally, I posted my comment on the author's google code page and left it.
- My final take would be to use jQueryui - well I can do with some complexity when I'm getting too many other plugins who share the same library. So, my vote goes to option #3
I've settled with the fact that it doesn't cache any search results and that it'll perform an AJAX based search upon each term as the user types.
I'll include the jQuery min file instead of including a bunch of diff files which size about the same when bundled. It is better to have a single file download rather then multiple chunks esp when that one file is as small as jquery min.
Other ref which might be preferable in certain situations:
hyjack: Cool because it converts a dropdown into auto-complete. Great if I was able to render the dropdown instead of dynamic lookup. http://frontensemble.com/hyjack/
jQuery Autocompleter: I had to let it go because of an issue with Parent-child auto-complete http://code.google.com/p/jquery-autocomplete/issues/detail?id=41
精彩评论