jQuery 是否有经过适当测试的 Select2 或 Chosen 替代品?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/15544693/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-26 15:17:10  来源:igfitidea点击:

Is there a properly tested alternative to Select2 or Chosen?

javascriptjqueryformstestingjquery-select2

提问by Joseph Tura

I am looking for an alternative to Select2 that basically provides the same functionality, but includes proper tests.

我正在寻找 Select2 的替代品,它基本上提供相同的功能,但包括适当的测试。

The quest for the holy grail? The last unicorn?

追求圣杯?最后一只独角兽?

回答by brianreavis

Selectize.jsis a select2 alternative I've been working on that has a suite of tests using a combination of testem, syn, mocha, and chai. Right now there are the following classes of tests:

Selectize.js是我一直在研究的 select2 替代方案,它有一套使用testemsynmochachai组合的测试。现在有以下几类测试:

  • Interaction
    Functional tests that makes sure the control behaves as if the user is using it (using syn).
  • Setup
    Ensures the control can be initialized properly from existing <select>and <input>elements.
  • API
    Tests core API methods for proper functionality.
  • Events
    Ensures built-in events get fired at the right times with the proper arguments.
  • XSS
    Tests a handful of potential exploits.
  • 交互
    功能测试,确保控件的行为就像用户正在使用它一样(使用syn)。
  • 设置
    确保控件可以从现有<select><input>元素正确初始化。
  • API
    测试核心 API 方法的正确功能。
  • 事件
    确保内置事件在正确的时间使用正确的参数被触发。
  • XSS
    测试一些潜在的漏洞利用。

With that said, the tests aren't as expansive as I want them to be, but it's getting there :)

话虽如此,测试并不像我希望的那样广泛,但它正在实现:)

回答by gustavohenke

Note:I'm no longer maintaining this project. Choose another one.

注意:我不再维护这个项目。选择另一个。



Bselect, which I develop, istested, however doesn't include all the features (yet) from Select2/Chosen.

我开发的Bselect已经过测试,但不包括 Select2/Chosen 中的所有功能(尚未)。

If you want, join me in its development :)

如果您愿意,请加入我的开发过程:)

回答by tanguy_k

Another possible alternative is bootstrap-multiselect

另一种可能的选择是bootstrap-multiselect

"JQuery multiselect plugin based on Twitter Bootstrap"

《基于 Twitter Bootstrap 的 JQuery 多选插件》

Examples and documentation: http://davidstutz.github.io/bootstrap-multiselect/

示例和文档:http: //davidstutz.github.io/bootstrap-multiselect/

  • The repository does not contain any automated tests, manual testsinstead
  • Themed using Bootstrap 3
  • JavaScript source code is short: 800 lines of code
  • 524 stars on GitHub (as of 2013/12/13)
  • 存储库不包含任何自动化测试,而是手动测试
  • 主题使用 Bootstrap 3
  • JavaScript 源代码很短:800 行代码
  • GitHub 上的 524 颗星(截至 2013/12/13)