Select2 is a jQuery based replacement for select boxes. It supports searching, remote data sets, and infinite scrolling of results.
MIT License
Bot releases are visible (Hide)
Published by kevin-brown almost 9 years ago
templateSelection
[https://github.com/select2/select2/pull/3324]:all:
is now correctly removed when used in containerCss
and dropdownCss
options [https://github.com/select2/select2/pull/3464]change
event was triggered [https://github.com/select2/select2/commit/698fe7b9e187e182f679aa679eb8b0ecb64a846b, https://github.com/select2/select2/commit/88503d2c67dc7f4fb9395a17f17edfe4948cf738, https://github.com/select2/select2/commit/dd2990adead92593a2dffff6ae004ea8b647d130]ArrayAdapter
where the existing <option>
data would be used instead of the array data [https://github.com/select2/select2/pull/3565]$dropdownContainer.width()
in the AttachBody
decorator [https://github.com/select2/select2/pull/3654]AttachBody
decorator [https://github.com/select2/select2/commit/671f5a2ce21005090e0b69059799cd3dd1fbbf84]open
event trigger [https://github.com/select2/select2/pull/3507]this
in ajax.data
and ajax.url
callback functions [https://github.com/select2/select2/issues/3361]<select>
not always being hidden correctly in some cases [https://github.com/select2/select2/pull/3301]maxiumSelectionLength
example [https://github.com/select2/select2/pull/3454]Option
parameters in the 4.0 announcement [https://github.com/select2/select2/pull/3547]inputTooLong
and inputTooShort
messages in the Galician translation [https://github.com/select2/select2/pull/3291]errorLoading
for Indonesian translation [https://github.com/select2/select2/pull/3635]errorLoading
for Danish translation [https://github.com/select2/select2/pull/3870]Published by kevin-brown about 9 years ago
This bug fix release comes 11 days after the release of Select2 3.5.3, so it is recommended to also check out that release when upgrading.
select2('data')
on a single select breaking [https://github.com/select2/select2/issues/3694]New features
This release does not add any new features, but it does add migration assistance for those who are looking to upgrade to Select2 4.0.0. These can be enabled by setting
debug: true
in your settings when initializing Select2.
- Warnings will be displayed when
debug
istrue
and deprecated or renamed options are being used [https://github.com/select2/select2/issues/3483]- Options renamed in 4.0.0 are supported under their new names [https://github.com/select2/select2/issues/3483]
Bug fixes
- Remove the remaining code for Internet Explorer 7 support [https://github.com/select2/select2/pull/2786]
- Hide the search box if the dropdown is empty [https://github.com/select2/select2/pull/2828]
- Improve performance issues in
setVal
[https://github.com/select2/select2/pull/2848]- Fix support for Zepto [https://github.com/select2/select2/pull/2866]
- Properly remove event handlers when destroying [https://github.com/select2/select2/pull/2925]
- Fix exception when no results are found using a multiple select.
This release is the final release under the 3.5.x line that will be handled by @kevin-brown. If you are interested in taking over the 3.5.x releases, contact Kevin Brown for more information.
Published by kevin-brown about 9 years ago
This release does not add any new features, but it does add migration assistance for those who are looking to upgrade to Select2 4.0.0. These can be enabled by setting debug: true
in your settings when initializing Select2.
debug
is true
and deprecated or renamed options are being used [https://github.com/select2/select2/issues/3483]setVal
[https://github.com/select2/select2/pull/2848]This release is the final release under the 3.5.3 that will be handled by @kevin-brown. If you are interested in taking over the 3.5.x releases, contact Kevin Brown for more information.
Published by kevin-brown over 9 years ago
This is the first release of Select2 4.0. You can view the release announcement for an overview of the larger changes.
This builds upon the second release candidate, so review all previous release notes before upgrading from previous versions of Select2.
jQuery.noConflict
.<select>
is the recommended element once again and can be used for all options.select2:closing
is triggered before the dropdown is closedselect2:select
is triggered when an option is selectedselect2-close
is now select2:close
select2-open
is now select2:open
select2-opening
is now select2:opening
select2-selecting
is now select2:selecting
select2-removed
is now select2:removed
select2-removing
is now select2:unselecting
select2-clearing
has been removed in favor of select2:unselecting
select2-highlight
select2-loaded
select2-focus
select2-blur
change
event were removed
val
can be retrieved with $element.val()
insteadadded
can be retrieved by listening to select2:select
removed
can be retrieved by listening to select2:unselect
Published by kevin-brown over 9 years ago
This is the second release candidate of Select2 4.0.
This builds upon the previous release candidate, so review all previous release notes before upgrading from previous versions of Select2.
select2.amd.js
build no longer exists, use select2.js
or select2.amd.js
instead. [https://github.com/select2/select2/commit/d1e8a6fdad700deba721aaf83c912e09db80eb5d]debug
option to make them visible again [https://github.com/select2/select2/commit/78c301f4fb848d06fc91776e46ec2cf5c96b0f3b]Published by kevin-brown over 9 years ago
This is the first release candidate of Select2 4.0.
This builds upon the previous beta release, so review all previous release notes before upgrading from previous versions of Select2.
<input type="text" />
tags was added back in for full builds. [https://github.com/select2/select2/pull/3051].select2('data')
can once again be used to retrieve a list of the selected options (read-only). [https://github.com/select2/select2/commit/61a231d868a9c0c8e227af0c331734825a72e82d]StopPropagation
modules available in the full builds to prevent this. [https://github.com/select2/select2/commit/8f8140e3b00c5d5bb232455137c4c633d7da4275]Published by kevin-brown over 9 years ago
This is the third beta release of Select2 4.0.
This builds upon the previous beta release, so review all previous release notes before upgrading from previous versions of Select2.
query
and initSelection
methods in the full builds.jQuery.noConflict
without any issues.en-US
) and Select2 will be able to determine what translation files to load.bower.json
/component.json
files.select2-clearing
- Removed in favor of select2:unselecting
which will be triggeredPublished by kevin-brown over 9 years ago
This is the second beta release of Select2 4.0.
This builds upon the previous beta release, so review all previous release notes before upgrading from previous versions of Select2.
amdPath
to the base path (including trailing slash) for the select2
sourceamdLanguagePath
to the base path for the select2/i18n
sourceselect2:closing
to complement select2:opening
select2:select
to complement select2:unselect
width
option has been changed from style
to resolve
.copy
value for the width
option has been renamed to style
.select2-highlight
select2-loaded
select2-focus
- Use the native focus
event insteadselect2-blur
- Use the native blur
event insteadchange
have been removed
val
- Use $element.val()
insteadremoved
- Use the select2:unselect
event insteadadded
- Use the select2-selected
event insteadcreateSearchChoice
-> createTag
selectOnBlur
-> selectOnClose
select2-open
-> select2:open
select2-opening
-> select2:opening
select2-close
-> select2:close
select2-selecting
-> select2:selecting
select2-removed
-> select2:unselect
select2-removing
-> select2:unselecting
Published by kevin-brown almost 10 years ago
This is the first beta release of Select2 4.0.
You can view the 4.0 release announcement for a detailed look into the changes in Select2. This is a full rewrite of the core Select2 code.
data-*
attributes<select>
has replaced <input type="hidden" />
for all options (including remote data)matcher
has been revamped to include full context, a compatibility module (select2/compat/matcher
) has been createdselectionAdapter
with the ClickMask
(select2/selection/clickMask
) decorator.formatSelection
-> templateSelection
formatResult
-> templateResult
sortResults
-> sorter
ajax.jsonpCallback
-> ajax.jsonp
ajax.results
-> ajax.processResults
tags: [array,of,data]
-> data: [array,of,data], tags: true
placeholderOption
has been replaced by placeholder.id
(placeholder
-> placeholder.text
)formatNoMatches
-> language.noMatches
formatSearching
-> language.searching
formatInputTooShort
-> language.inputTooShort
formatInputTooLong
-> language.inputTooLong
formatAjaxError
-> language.errorLoading
formatLoading
-> language.loadingMore
formatSelectionTooBig
-> language.maximumSelected
.select2("val", [value])
-> .val([value])
.select2("enable", !disabled)
-> .prop("disabled", disabled)
initSelection
- This is no longer needed with <select>
tags - Read more in the announcement
id
- Data objects should now always have id
and text
attributes that are strings, use $.map
when migratingquery
- Use a custom data adapter instead - Read more in the announcement
ajax.params
- All parameters passed to ajax
will be passed to the AJAX data transport function.select2("onSortStart")
and .select2("onSortEnd")
- A custom selection adapter should be created instead.select2("data", data)
- Create the <option>
tags for the objects that you would like to set, and set the .val
to select them.select2("readonly")
- There is no way to make a <select>
element read-only, disable it instead