jQuery 自动完成下拉框

发布于 2024-11-15 21:37:20 字数 1950 浏览 2 评论 0原文

经过近两天的搜索和研发,我终于得出了以下一些基于 jQuery 的自动完成插件,我发现它们值得并且适合我的网络应用程序。

我有一个基于 MVC2 的 Web 应用程序,正在使用 ASP.Net C# 开发。我将 L2S (LINQ to SQL) 作为我的 DAL,并使用服务层架构通过 L2S 获取数据。

现在,我要进行一些“查找” 其中选择列表可能 很大(即 1000 条或更多记录),所以 有时我想要自动完成的外观 最多是动态的(即我给页面 从中它将获得值和 显示在下拉菜单中)但是有 简单的也喜欢10-20个值 我想静态渲染。

简而言之,我需要一些简单且直接的自动完成插件,它可以完成这项工作,而不需要问我太多问题或需要太多 .js 文件(当然不包括 jQuery)。

这是我的研发总结以及我的结论 -

*请考虑上面的(点)作为我的评分。经过一些见解和演示评论后,我得出的结论是,我将使用#4 dyve.net 自动完成插件,因为它似乎可以完成我需要的一切,最重要的是它并不复杂。

你会发现#3 功能丰富,而且有更多功能,但它很大而且很复杂,所以我必须选择它。仅供参考,#2 只不过是 #3 的主要版本(但我面临的唯一问题是它(#2)只有开头匹配,包含匹配要好得多)

希望我走上正轨。


编辑:

经过一晚的外出之后 20个小时的奋斗和 实验。我的结论是 jQuery 我需要选择一些东西 哪个有更大的支持。和 选项#4 - 主要问题来了 当我想根据父项填充子项下拉列表时 它确实会动态填充,但它也会保留旧项目,因此在搜索时 - 旧项目会弹出! 我尝试了它的cacheFlush等,但没有成功。最后,我在作者的 google 代码页上发表了我的评论并留下了它。

  • 我的最终选择是使用 jQueryui - 我可以做一些 当我得到太多时变得复杂 共享相同内容的其他插件 图书馆。所以,我投票给选项 #3

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 -

*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 searching - 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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

眼波传意 2024-11-22 21:37:20

我已经接受了这样一个事实:它不会缓存任何搜索结果,并且会在用户键入时对每个术语执行基于 AJAX 的搜索。

我将包含 jQuery min 文件,而不是包含一堆捆绑时大小大致相同的 diff 文件。最好下载单个文件,而不是下载多个块,尤其是当一个文件小到 jquery min 时。

在某些情况下可能更适合的其他参考:

hyjack:很酷,因为它将下拉菜单转换为自动完成。太好了,如果
我能够渲染下拉菜单
而不是动态查找。
http://frontensemble.com/hyjack/

jQuery 自动完成器: 由于出现问题,我不得不放弃它
亲子自动完成
http://code.google.com/p/jquery-autocomplete /issues/detail?id=41

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文