@@ -98,6 +98,31 @@ <h2>Plugin system</h2>
9898
9999 < section id ="amd-builds ">
100100 < h2 > AMD-based build system</ h2 >
101+
102+ < p >
103+ Select2 now uses an
104+ < a href ="https://en.wikipedia.org/wiki/Asynchronous_module_definition "> AMD-based build system</ a > ,
105+ allowing for builds that only require the parts of Select2 that you need.
106+ While a custom build system has not yet been created, Select2 is open
107+ source and will gladly accept a pull request for one.
108+ </ p >
109+
110+ < p >
111+ Select2 includes the minimal < a href ="https://github.com/jrburke/almond "> almond</ a >
112+ AMD loader, but a custom < code > select2.amd.js</ code > build is available
113+ if you already use an AMD loader. The code base (available in the
114+ < code > src</ code > directory) also uses AMD, allowing you to include Select2
115+ in your own build system and generate your own builds alongside your
116+ existing infrastructure.
117+ </ p >
118+
119+ < p >
120+ The AMD methods used by Select2 are available as
121+ < code > jQuery.fn.select2.amd.define()/require()</ code > , allowing you to use the
122+ included almond loader. These methods are primarily used by the
123+ translations, but they are the recommended way to access custom modules
124+ that Select2 provides.
125+ </ p >
101126 </ section >
102127
103128 < section id ="migrating ">
@@ -179,7 +204,8 @@ <h2 id="new-matcher">Advanced matching of searches</h2>
179204 < p >
180205 A function has been created that allows old-style matcher functions to be
181206 converted to the new style. You can retrieve the function from the
182- < code > select2/compat/matcher</ code > module.
207+ < code > select2/compat/matcher</ code > module, which should just wrap the old
208+ matcher function.
183209 </ p >
184210
185211 < h2 id ="flexible-placeholders "> More flexible placeholders</ h2 >
@@ -234,5 +260,54 @@ <h2 id="flexible-placeholders">More flexible placeholders</h2>
234260 the old functionality of Select2 where the placeholder option was blank by
235261 default.
236262 </ p >
263+
264+ < h2 id ="value-ordering "> Display reflects the actual order of the values</ h2 >
265+
266+ < p >
267+ In past versions of Select2, choices were displayed in the order that
268+ they were selected. In cases where Select2 was used on a
269+ < code > <select></ code > element, the order that the server recieved
270+ the selections did not always match the order that the choices were
271+ displayed, resulting in confusion in situations where the order is
272+ important.
273+ </ p >
274+
275+ < p >
276+ Select2 will now order selected choices in the same order that will be
277+ sent to the server.
278+ </ p >
279+
280+ < h2 id ="removed-methods "> Deprecated and removed methods</ h2 >
281+
282+ < p >
283+ As Select2 now uses a < code > <select></ code > element for all data
284+ sources, a few methods that were available by calling
285+ < code > .select2()</ code > are no longer required.
286+ </ p >
287+
288+ < h3 > .select2("val")</ h3 >
289+
290+ < p >
291+ The < code > val</ code > method has been deprecated and will be removed in
292+ Select2 4.1. The deprecated method no longer includes the
293+ < code > triggerChange</ code > parameter.
294+ </ p >
295+
296+ < p >
297+ You should directly call < code > val</ code > on the underlying
298+ < code > <select></ code > element instead. If you needed the second
299+ parameter (< code > triggerChange</ code > ), you should also call
300+ < code > .trigger("change")</ code > on the element.
301+ </ p >
302+
303+ < h3 > .select2("enable")</ h3 >
304+
305+ < p >
306+ Select2 will respect the < code > disabled</ code > property of the underlying
307+ select element. In order to enable or disable Select2, you should call
308+ < code > .prop('disabled', true/false)</ code > on the
309+ < code > <select></ code > element. This method will be completely
310+ removed in Select2 4.1.
311+ </ p >
237312 </ section >
238313</ div >
0 commit comments