In the past, `initSelection` was used for loading in data objects
for the pre-selected options. Now that Select2 is using a `<select>`
element, there is no need for doing this because the `<option>`
elements should provide the relevant information. So you can now
just pull this information from the remote data source
(or static array, in some cases) and build out the `<option>`
elements manually.
In most cases you don't need to go the full length with a custom
data adapter, but instead are just looking to pre-load elements on
the initial page load.
This improves https://github.com/select2/select2/issues/3116.
This adds documentation for the `templateResult` and
`templateSelection` options. The fact that placeholders and
custom messages are templated was noted, although most people
should be using the standard `text` property that they provide
anyway. This fixes the templating link provided in the release
announcement to link to the correct location in the documentation.
This also adds support for the `templateSelection` function to
return a DocumentFragment or jQuery compatible object to be
passed back and rendered.
This closes https://github.com/select2/select2/issues/3005.
This closes https://github.com/select2/select2/issues/3019.
This also adds more documentation and corrects the release notes
for these breaking changes. These modules will now only be included
in the full builds of Select2, which has been noted in a few places.
This adds detailed docs explaining how you can convert the old
implementations of `query` and `initSelection` into a custom data
adapter using the `current` and `query` methods provided there.
Examples are included that should make it considerably easier to
handle.
The documentation for templates still needs to be created.
A warning is now generated in the console for applications using
the previous data attributes that have been migrated.