github select2/select2 4.0.0-beta.1
4.0.0 Beta 1

latest releases: 4.1.0-rc.0, 4.1.0-beta.1, 4.1.0-beta.0...
pre-release9 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.

New features

Breaking changes

Renamed options

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

Internationalization

  • formatNoMatches -> language.noMatches
  • formatSearching -> language.searching
  • formatInputTooShort -> language.inputTooShort
  • formatInputTooLong -> language.inputTooLong
  • formatAjaxError -> language.errorLoading
  • formatLoading -> language.loadingMore
  • formatSelectionTooBig -> language.maximumSelected

Renamed methods

  • .select2("val", [value]) -> .val([value])
  • .select2("enable", !disabled) -> .prop("disabled", disabled)

Removed options

Removed methods

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

Don't miss a new select2 release

NewReleases is sending notifications on new releases.