114

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

The quest for the holy grail? The last unicorn?

j0k
  • 22,600
  • 28
  • 79
  • 90
Joseph Tura
  • 6,290
  • 8
  • 47
  • 73

3 Answers3

126

Selectize.js is 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:

  • 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.

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

cytsunny
  • 4,838
  • 15
  • 62
  • 129
brianreavis
  • 11,562
  • 3
  • 43
  • 50
  • 9
    Thanks for Selectize.js, I found it so much better and easier to use than Chosen or Select2. But please, release it on npm so I can install it and use with browserify without a hassle instead of storing sources in vendor directory. – andreypopp Aug 03 '13 at 00:09
  • Thanks for this. I have been looking around at different select list & tag replacements - not sure why it took this long to find Selectize. – Hippie May 19 '14 at 11:48
  • @andreypopp you can always do this https://www.npmjs.org/doc/files/package.json.html#github-urls – kenwarner Sep 13 '14 at 16:04
  • 1
    It's nice and pretty, but completely useless when using it with remote data, which is really where select2 shines. – Jelle De Loecker Oct 21 '14 at 20:41
  • 2
    After wasting 2 days behind Select2, finally went for Selectize.js. And could make it up and running Ajax drop down neatly in few mins. Neat and Clear examples, very good documentation. – Tejasvi Hegde Jan 23 '15 at 09:00
  • @skerit I found it much easier than select2 even when using with remote data. I belive Select2 is much hyped (sorry, but its my personal opinion, I am not biased towards anyone. Personally I first tried Select2 and then went for Selectize) – Tejasvi Hegde Jan 23 '15 at 09:02
  • @skerit is right, I have an ajax powered select with selectize and I need to change its value and reset the value. I can't, Is too difficult – Axel A. García Feb 22 '15 at 21:39
  • Note: Selectize does NOT support `disabled` states for ` –  Mar 03 '15 at 10:21
  • @Rygu It does support disabled ` – brianreavis Mar 04 '15 at 07:52
  • I spent 1.5 days with Select2 and it still wasn't good enough. I also tried Selectivity, which didn't do what I needed either. I swapped over to Selectize and had it wrapped up in an hour. Cheers. – n8n8baby Mar 27 '15 at 17:58
  • 1
    FYI selectize is on npm now so dead easy to integrate if you are using browserify/CommonJS. See https://www.npmjs.com/package/selectize – Ted Jun 10 '15 at 22:27
  • 1
    If anybody is looking for a alternative to Selectize that doesn't require jQuery as a dependency, I wrote my own plugin: https://github.com/jshjohnson/Choices – jshjohnson Aug 09 '16 at 20:51
  • Please also mention **Which is Mobile friendly Select2 or Selectize or Chosen ?** – Shaiju T Oct 19 '16 at 07:30
  • Wow, this is very nice and clean after years of Select2 and Chosen! Lovely. – Tails Jun 03 '20 at 20:01
  • Addendum, Selectize.js is dead. Go with Choices from @jshjohnson. – Tails Jun 03 '20 at 20:53
4

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


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

If you want, join me in its development :)

gustavohenke
  • 40,997
  • 14
  • 121
  • 129
4

Another possible alternative is bootstrap-multiselect

"JQuery multiselect plugin based on Twitter Bootstrap"

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

  • The repository does not contain any automated tests, manual tests instead
  • Themed using Bootstrap 3
  • JavaScript source code is short: 800 lines of code
  • 524 stars on GitHub (as of 2013/12/13)
tanguy_k
  • 11,307
  • 6
  • 54
  • 58