Finish off the core option answers
These were mostly there before, it was just a matter of moving some of the answers around.
This commit is contained in:
parent
4541d83c5d
commit
e472cb31f0
@ -31,4 +31,8 @@ $.fn.select2.defaults.set('amdLanguageBase', 'select2/i18n/');
|
|||||||
<p>
|
<p>
|
||||||
Due to a bug in older versions of the r.js build tool, Select2 was sometimes placed before jQuery in then compiled build file. Because of this, Select2 will trigger an error because it won't be able to find or load jQuery.
|
Due to a bug in older versions of the r.js build tool, Select2 was sometimes placed before jQuery in then compiled build file. Because of this, Select2 will trigger an error because it won't be able to find or load jQuery.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
You can fix this issue by upgrading to a newer version of the r.js build tool.
|
||||||
|
</p>
|
||||||
</section>
|
</section>
|
@ -19,7 +19,7 @@
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
<pre class="prettyprint">
|
<pre class="prettyprint">
|
||||||
<select data-tags="true" data-placeholder="Select an option"></select>
|
<select data-tags="true" data-placeholder="Select an option" data-allow-clear="true"></select>
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
@ -29,7 +29,8 @@
|
|||||||
<pre class="prettyprint linenums">
|
<pre class="prettyprint linenums">
|
||||||
$("select").select2({
|
$("select").select2({
|
||||||
tags: "true",
|
tags: "true",
|
||||||
placeholder: "Select an option"
|
placeholder: "Select an option",
|
||||||
|
allowClear: true
|
||||||
});
|
});
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
How should Select2 be initialized?
|
How should Select2 be initialized?
|
||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
<h3>
|
<h3 id="setting-default-options">
|
||||||
Can default options be set for all dropdowns?
|
Can default options be set for all dropdowns?
|
||||||
</h3>
|
</h3>
|
||||||
|
|
||||||
@ -24,12 +24,7 @@
|
|||||||
|
|
||||||
<p>
|
<p>
|
||||||
<strong>You can set default options</strong> by calling
|
<strong>You can set default options</strong> by calling
|
||||||
<code>$.fn.select2.defaults.set("key", "value")</code>. The key that is
|
<code>$.fn.select2.defaults.set("key", "value")</code>.
|
||||||
set should take the same format as keys set using
|
|
||||||
<a href="#data-attributes">HTML <code>data-*</code> attributes</a> which
|
|
||||||
means that two dashes (<code>--</code>) will be replaced by a level of
|
|
||||||
nesting, and a single dash (<code>-</code>) will convert it to a camelCase
|
|
||||||
string.
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<pre class="prettyprint">
|
<pre class="prettyprint">
|
||||||
@ -40,6 +35,15 @@ $.fn.select2.defaults.set("theme", "classic");
|
|||||||
How can I set a default value for a nested option?
|
How can I set a default value for a nested option?
|
||||||
</h3>
|
</h3>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
The key that is
|
||||||
|
set should take the same format as keys set using
|
||||||
|
<a href="#data-attributes">HTML <code>data-*</code> attributes</a> which
|
||||||
|
means that two dashes (<code>--</code>) will be replaced by a level of
|
||||||
|
nesting, and a single dash (<code>-</code>) will convert it to a camelCase
|
||||||
|
string.
|
||||||
|
</p>
|
||||||
|
|
||||||
<h3>
|
<h3>
|
||||||
How can I reset all of the global default options?
|
How can I reset all of the global default options?
|
||||||
</h3>
|
</h3>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user