| 776 |
lars |
1 |
Select2
|
|
|
2 |
=======
|
|
|
3 |
[![Build Status][travis-ci-image]][travis-ci-status]
|
|
|
4 |
|
|
|
5 |
Select2 is a jQuery-based replacement for select boxes. It supports searching,
|
|
|
6 |
remote data sets, and pagination of results.
|
|
|
7 |
|
|
|
8 |
To get started, checkout examples and documentation at
|
|
|
9 |
https://select2.github.io/
|
|
|
10 |
|
|
|
11 |
Use cases
|
|
|
12 |
---------
|
|
|
13 |
* Enhancing native selects with search.
|
|
|
14 |
* Enhancing native selects with a better multi-select interface.
|
|
|
15 |
* Loading data from JavaScript: easily load items via AJAX and have them
|
|
|
16 |
searchable.
|
|
|
17 |
* Nesting optgroups: native selects only support one level of nesting. Select2
|
|
|
18 |
does not have this restriction.
|
|
|
19 |
* Tagging: ability to add new items on the fly.
|
|
|
20 |
* Working with large, remote datasets: ability to partially load a dataset based
|
|
|
21 |
on the search term.
|
|
|
22 |
* Paging of large datasets: easy support for loading more pages when the results
|
|
|
23 |
are scrolled to the end.
|
|
|
24 |
* Templating: support for custom rendering of results and selections.
|
|
|
25 |
|
|
|
26 |
Browser compatibility
|
|
|
27 |
---------------------
|
|
|
28 |
* IE 8+
|
|
|
29 |
* Chrome 8+
|
|
|
30 |
* Firefox 10+
|
|
|
31 |
* Safari 3+
|
|
|
32 |
* Opera 10.6+
|
|
|
33 |
|
|
|
34 |
Usage
|
|
|
35 |
-----
|
|
|
36 |
You can source Select2 directly from a CDN like [JSDliver][jsdelivr] or
|
|
|
37 |
[CDNJS][cdnjs], [download it from this GitHub repo][releases], or use one of
|
|
|
38 |
the integrations below.
|
|
|
39 |
|
|
|
40 |
Integrations
|
|
|
41 |
------------
|
|
|
42 |
* [Wicket-Select2][wicket-select2] (Java / [Apache Wicket][wicket])
|
|
|
43 |
* [select2-rails][select2-rails] (Ruby on Rails)
|
|
|
44 |
* [AngularUI][angularui-select] ([AngularJS][angularjs])
|
|
|
45 |
* [Django][django-select2]
|
|
|
46 |
* [Symfony][symfony-select2]
|
|
|
47 |
* [Symfony2][symfony2-select2]
|
|
|
48 |
* [Bootstrap 2][bootstrap2-select2] and [Bootstrap 3][bootstrap3-select2]
|
|
|
49 |
(CSS skins)
|
|
|
50 |
* [Meteor][meteor-select2] ([Bootstrap 3 skin][meteor-select2-bootstrap3])
|
|
|
51 |
* [Meteor][meteor-select2-alt]
|
|
|
52 |
* [Yii 2.x][yii2-select2]
|
|
|
53 |
* [Yii 1.x][yii-select2]
|
|
|
54 |
* [AtmosphereJS][atmospherejs-select2]
|
|
|
55 |
|
|
|
56 |
Internationalization (i18n)
|
|
|
57 |
---------------------------
|
|
|
58 |
Select2 supports multiple languages by simply including the right language JS
|
|
|
59 |
file (`dist/js/i18n/it.js`, `dist/js/i18n/nl.js`, etc.) after
|
|
|
60 |
`dist/js/select2.js`.
|
|
|
61 |
|
|
|
62 |
Missing a language? Just copy `src/js/select2/i18n/en.js`, translate it, and
|
|
|
63 |
make a pull request back to Select2 here on GitHub.
|
|
|
64 |
|
|
|
65 |
Documentation
|
|
|
66 |
-------------
|
|
|
67 |
The documentation for Select2 is available
|
|
|
68 |
[through GitHub Pages][documentation] and is located within this repository
|
|
|
69 |
in the [`docs` folder][documentation-folder].
|
|
|
70 |
|
|
|
71 |
Community
|
|
|
72 |
---------
|
|
|
73 |
You can find out about the different ways to get in touch with the Select2
|
|
|
74 |
community at the [Select2 community page][community].
|
|
|
75 |
|
|
|
76 |
Copyright and license
|
|
|
77 |
---------------------
|
|
|
78 |
The license is available within the repository in the [LICENSE][license] file.
|
|
|
79 |
|
|
|
80 |
[angularjs]: https://angularjs.org/
|
|
|
81 |
[angularui-select]: http://angular-ui.github.io/#ui-select
|
|
|
82 |
[atmospherejs-select2]: https://atmospherejs.com/package/jquery-select2
|
|
|
83 |
[bootstrap2-select2]: https://github.com/t0m/select2-bootstrap-css
|
|
|
84 |
[bootstrap3-select2]: https://github.com/t0m/select2-bootstrap-css/tree/bootstrap3
|
|
|
85 |
[cdnjs]: http://www.cdnjs.com/libraries/select2
|
|
|
86 |
[community]: https://select2.github.io/community.html
|
|
|
87 |
[django-select2]: https://github.com/applegrew/django-select2
|
|
|
88 |
[documentation]: https://select2.github.io/
|
|
|
89 |
[documentation-folder]: https://github.com/select2/select2/tree/master/docs
|
|
|
90 |
[freenode]: https://freenode.net/
|
|
|
91 |
[jsdelivr]: http://www.jsdelivr.com/#!select2
|
|
|
92 |
[license]: LICENSE.md
|
|
|
93 |
[meteor-select2]: https://github.com/nate-strauser/meteor-select2
|
|
|
94 |
[meteor-select2-alt]: https://jquery-select2.meteor.com
|
|
|
95 |
[meteor-select2-bootstrap3]: https://github.com/zimme/meteor-select2-bootstrap3-css/
|
|
|
96 |
[releases]: https://github.com/select2/select2/releases
|
|
|
97 |
[select2-rails]: https://github.com/argerim/select2-rails
|
|
|
98 |
[symfony-select2]: https://github.com/19Gerhard85/sfSelect2WidgetsPlugin
|
|
|
99 |
[symfony2-select2]: https://github.com/avocode/FormExtensions
|
|
|
100 |
[travis-ci-image]: https://travis-ci.org/select2/select2.svg?branch=master
|
|
|
101 |
[travis-ci-status]: https://travis-ci.org/select2/select2
|
|
|
102 |
[wicket]: http://wicket.apache.org
|
|
|
103 |
[wicket-select2]: https://github.com/ivaynberg/wicket-select2
|
|
|
104 |
[yii-select2]: https://github.com/tonybolzan/yii-select2
|
|
|
105 |
[yii2-select2]: http://demos.krajee.com/widgets#select2
|